Follow by Email

Wednesday, 26 August 2015

Difference between == and === in JS

Example:

== only compares values
=== compares values + type

var test1 = '11',
    test2 = 11;

test1 == test2 // true

test1 === test2 // false

0 comments:

Post a Comment


                                                            

 
Design by Abhinav Ranjan Sinha