Report Bug
Qus :

What is the output of the following code?

console.log(2 == "2");
console.log(2 === "2");

Qus

निम्नलिखित कोड का परिणाम क्या है?

console.log(2 == "2");
console.log(2 === "2");


A. true, false
B. false, true
C. true, true
D. false, false


Solution
A. true, false



Explanation

== operator is used to matches only value while === compare the value and data type also. 




Report Bug