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. 

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad