Q. What will be the output of the following JavaScript code snippet?
Code:// JavaScript Equalto Operators
function equalto()
{
let num=10;
if(num==="10")
return true;
else
return false;
}
β
Correct Answer: (A)
false
Explanation: A === operator in JS is only true if the operands are of the same type and the contents match. Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions. In this case, we are comparing an integer and a string so it will be false.