All Questions
2 questions
5
votes
1
answer
2k
views
Why can a constructor be used without `new` keyword in Javascript?
I found Date can be used without the new keyword.
Date(1)
> "Thu May 28 2015 15:54:20 GMT+0800 (CST)"
new Date(1)
> Thu Jan 01 1970 08:00:00 GMT+0800 (CST)
I was wondering whether there is any ...
0
votes
1
answer
385
views
How to make C# methods work like javascript functions? [closed]
I'll keep it simple, I want to make C#'s methods work like javascript's functions. Mainly so I can convert this -
function makeVariable(terp) {
var me = {value: 0};
return function () { terp....