Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following JavaScript code?
function equalto()
{
int num=10;
if(num===”10”)
return true;
else
return false;
}

What will be the output of the following JavaScript code?
function equalto()
{
int num=10;
if(num===”10”)
return true;
else
return false;
}
a) false
b) true
c) compilation error
d) runtime error

Answer: b
Explanation: A === operator 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.

Join The Discussion