Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, weakly-typed language used for both client-side and server-side scripting. Use this tag for questions regarding common implementations of ECMAScript, JavaScript, JScript, etc. JS does not typically refer to its ECMA-cousin, ActionScript.
9
votes
Falsy values vs null, undefined, or empty string
The set of "truthy" and "falsey" values in JavaScript comes from the ToBoolean abstract operation defined in the ECMAScript spec, which is used when coercing a value to a boolean:
+------------------- …
2
votes
Why is the use of constructors discouraged when creating prototypes?
Now that my understanding has broadened a bit, I'd like to build on Esailija's answer with a specific example:
One specific concern is that a constructor can set instance-specific properties. Thus, i …
7
votes
Accepted
How can 'yield' be added as a keyword in ES6 if it wasn't a reserved word?
In ECMAScript 5, yield is a strict-mode "Future Reserved Word":
7.6.1.2 Future Reserved Words
The following words are used as keywords in proposed extensions and are therefore reserved to allow for t …
10
votes
2
answers
1k
views
Why is the use of constructors discouraged when creating prototypes?
Quick background: In JavaScript, the constructor function for each object type has a prototype property. …
18
votes
A few clarifications about the DOM
In fact, if you look at the question Meaning of “Moving DOM into Javascript”? … what is responsible for translating from JavaScript to the native language? …
0
votes
Javascript Use of Window Object through alternate means
Let's look at the ECMAScript 5 specification for Array.prototype.sort:
Let obj be the result of calling ToObject passing the this value as the argument.
And when we examine ToObject, we see a fa …
1
vote
HTML Canvas: Should my app x, y values be global?
...is it bad practice/architecture to have these x,y values in the global namespace... like so?
In your code, your x and y aren't in the global namespace; they're properties of App. That's a good …
5
votes
Accepted
Please explain object versioning in the nodejs module system
I think the critical piece you're missing is that the result of require("foo") is always the same object. Consider this REPL example:
> var myHttpModule = require("http")
{ ... }
> myHttpModule.someN …
4
votes
why regex, when using global search and {0,} quantifier, match the end of the string?
match is just a wrapper for exec, per ES5 15.5.4.10, step 8(f)(i):
Let result be the result of calling the [[Call]] internal method of exec with rx as the this value and argument list containing S …