Posts

Showing posts from October, 2017

Difference between == & === in JavaScript

== Check value only. === Check value and its type also. <! DOCTYPE html > < html lang ="en" xmlns ="http://www.w3.org/1999/xhtml"> < head >     < meta charset ="utf-8" />     < title > Difference between == & === in JavaScript </ title > </ head > < body >     < script type ="text/javascript">         var b = true ;         if (b == 1) // return true         {             document.writeln( "Check value only" );         }         if (b === 1) // return false as variable "b" is boolean type and "1" is number         {          ...