Performance of === vs. ==
One particular weirdness and unpleasantry in JavaScript is the set of equality operators. Like virtually every language, JavaScript has the standard ==
, !=
, <
, >
, <=
, and >=
operators. However, ==
an...
One particular weirdness and unpleasantry in JavaScript is the set of equality operators. Like virtually every language, JavaScript has the standard ==
, !=
, <
, >
, <=
, and >=
operators. However, ==
an...
I was talking with a co-worker today about the behavior of setTimeout
and setInterval
when given a small interval, like 0
or 1
. The expectation would be tha...
Take a look at this web site. Notice anything out of the ordinary. Hopef...
When I interview web developers, my first JavaScript question is usually the following:
What is the difference, in JavaScript, betweenx = 1
andvar x = 1
. Feel free to answer in as much ...
Do you know what value will be alerted if the following is executed as a JavaScript program?
var foo = 1;
function bar() {
if (!foo) {
var foo = 10;
}
alert(foo);
}
bar();
If it surprises you that the answer is “10”, then this one will probably really th...