JavaScript is a scripting language, and variables are not assigned a type during declaration. Instead, types are interpreted as the code runs.
"= = =" checks for both the type(first) and the value, while "= =" checks only for the value.
Example:
if("5"==5) { console.log('here, it is just Value check'); } if("5"===5) { console.log('\n Here, it is value & type check'); } else { console.log('\n above is false'); } Output: here it is just Value check above is false
Comments
Post a Comment