1.The following will evaluate display false. var a = 1; var b = "1"; console.log(a === b); True or False? 2.What is the value of a after executing the following code snippet? var a = 1; a += 1; 1 undefined 2 0 3.Operators at the same level of precedence associate(evaluate) from right to left. True or False? 4.The following code will display true. var a = 1; var b = 2; console.log(a === b); True or False?
1.The following will evaluate display false.
var a = 1;
var b = "1";
console.log(a === b);
True or False?
2.What is the value of a after executing the following code snippet?
var a = 1;
a += 1;
1
undefined
2
0
3.Operators at the same level of precedence associate(evaluate) from right to left.
True or False?
4.The following code will display true.
var a = 1;
var b = 2;
console.log(a === b);
True or False?
![](/static/compass_v2/shared-icons/check-mark.png)
1- false
var a = 1;
var b = "1";
console.log(a === b);
=== (Triple equals) is a strict equality comparison operator in JavaScript, which returns false for the values which are not of a comparable type. This operator performs kind casting for equality. If we examine 2 with "2" using ===, then it will return a false.
Strict equality === tests that values are identical or no longer.
Value isn't implicitly transformed to some different fee before assessment.
If the variable values are of various sorts, then the values are considered unequal.
If the variable is of the same kind, is not numeric, and features the identical cost, they're taken into consideration the same.
Lastly, If both variable values are numbers, they're taken into consideration the same if each isn't NaN (Not a Number) and are the same value.
2.
2
var a = 1;
a += 1;
a value is 1 as a number then a +=1 it means a=a+1.
a=a+1; // a value is already 1 now.
a=1+1 =2;
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)