The first question in the quiz for a full-stack developer is about the difference between == and === equality operands in JavaScript.
What result (true or false) is produced by the last expression in each of the following JavaScript blocks?
-
var a = 3;
var b = 3;
a == b -
var a = 3;
var b = 3;
a === b -
var a = 3;
var b = a;
a == b -
var a = 3;
var b = a;
a === b -
1 == 1
-
1 === 1
-
1 == "1"
-
1 === "1"
-
1 == "2"
-
1 === "2"
-
1 == 2
-
1 === 2
For answers scroll down
.
.
.
.
.
.
1. true
2. true
3. true
4. true
5. true
6. true
7. true
8. false
9. false
10. false
11. false
12. false
More information about equality operators can be found in a separate article.