JavaScript Interview questions


Total available count: 22
Subject - JavaScript Frameworks
Subsubject - JavaScript

What is the difference between == and === operator?

“==” is called equality operator and “===” is called Identity operator.
 The equality operator (==) will attempt to make the data types the same before proceeding. On the other hand, the identity operator (===) requires both data types to be the same.

var currentTime1 = 9;
var currentTime2 = "9";
console.log("Equality operator == ");
if (currentTime1 == currentTime2) {
    console.log("Both Time values are same");
} else {
    console.log("Both Time values are not same");
          }
console.log("Identity operator === ");
if (currentTime1 === currentTime2) {
    console.log("Both Time values are same");
} else {
    console.log("Both Time values are not same");
}

 

Result:
Equality operator == 
Both Time values are same
Identity operator ===
Both Time values are not same




Next 5 interview question(s)

1
What are setTimeout, setInterval and clearInterval in JavaScsript?
2
What do mean by NULL in JavaScript?
3
What is an undefined value in JavaScript?
4
What are all the types of Pop up boxes available in JavaScript?
5
What are all the looping structures in JavaScript?