In javascript, is it better to use two equal signs or three when comparing variables -


i have noticed quite few people use 3 equals signs when comparing things in javascript, taught use two. can shed light on why use 3 or two, , why both work?

-thanks :)

another user has pointed out question has been asked, sorry guys, going @ answers on one.

all following evaluations return true

with == js will type-juggle.

1 == '1' 1 == 1 1 == true 0 != true 0 == false 

with === js will not type-juggle

1 !== '1' 1 === 1 1 !== true 0 !== false 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -