- Equal (==) - if the value is same returns true, else false - number == string; returns true var a = 20; var b = "20"; a == b; true - Strict equal (===) - if the value and is same returns true, else false - number === number, string === string returns true var a = 20; var b = 20; a === b; true var a = 20; var b = "20"; a === b; false -Not equal (!=) - if the value is not the same returns true, else false var a = 5; var b = 4; a != b; true Strict not equal (!==) - if the value is not the same return true, else false - number to number, string to string returns true var a = 2; var b = "2"; a !== b; true
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter