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, falseExplanation
== operator is used to matches only value while === compare the value and data type also.