Front End Developer (AngularJS) Question:
Explain difference between == and ===?
Answer:
This is pretty simple but at the same time some people never came across a triple equals or never wondered what's the difference.
Double equals == is used to compare the value of two operands:
"2" == 2; // true
2 == 2; // true
Triple equals === is used to compare the value AND type of two operands:
"2" === 2; // false
2 === 2; // true
Double equals == is used to compare the value of two operands:
"2" == 2; // true
2 == 2; // true
Triple equals === is used to compare the value AND type of two operands:
"2" === 2; // false
2 === 2; // true
Previous Question | Next Question |
Tell me what is CoffeeScript? | How can you add a method to a class already defined? |