You work as a developer at ABC.com. The ABC.com network consists of a single domain named
ABC.com.
You have been instructed to test the value of the variable shown below:
var length = “50”;
You then write the following code:
if (length === 50)
Which of the following is the purpose of this line of code?
A.
It prevents a block of code from firing if the length equals 50, and the data type is integer.
B.
It prevents a block of code from firing if the length equals 50, and the data type is string.
C.
It allows for a block of code to fire if the length equals 50 regardless of the data type.
D.
It allows a block of code from firing if the length equals 50 depending on the data type.
Explanation:
confusing wording of answers from a botched copy and paste…
also B would be correct but not the “most” correct answer.
http://procbits.com/2012/01/19/comparing-two-javascript-objects
Better reference:
http://www.w3schools.com/js/js_comparisons.asp
Actually w3schools is not the best reference. MDN and Css-Tricks are constantly updated and tested resources you should read.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness