Skip to main content

Posts

Showing posts from 2015

Java script "==" & "===" operator

Java script is an integral part of any web development. To check the equality between two variables or objects it provides us two different ways. One way is "==" which is known as "equality operator" which perform "type coercion" , and other way is using "===" known as "identity operator". Let's try to understand their behavior.   If we're comparing two operands with same data types then both of them will behaves as per our expectation. e.g. 1 == 1 (true) 1===1 (true) "one" == "one" (true) "one" === "one" (true) 3.1 == 3.1 (true) 3.1 === 3.1 (true) false == false (true) false === false (true) ...