Example :
var a= 99; // variable a assigned the integer value .
var b="99"; // variable b assigned the string value .
if(a==b)
{
console.log(" using == to : True");
}
else
{
console.log(" using == to : False");
}
if(a===b)
{
console.log(" using === to : True")
}
else
{
console.log(" using === to : False");
}
// == is just check value
// === is check value and its data type
o/p :
using == to : True
using === to : False
No comments:
Post a Comment