Front End Developer (AngularJS) Question:

Download Job Interview Questions and Answers PDF

Explain difference between == and ===?

Front End Developer (AngularJS) Interview Question
Front End Developer (AngularJS) Interview Question

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

Download Front End Developer (AngularJS) Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me what is CoffeeScript?How can you add a method to a class already defined?