Tuesday 15 January 2013

figuring out javascript equality operator -



figuring out javascript equality operator -

while trying understand difference between equality operator , identity operator, came across article @ msdn explains both do, in terms of inner workings, still had few doubts , decided create flowchart have improve picture. question is, flowchart correct? or missing something?

it's understanding identity operator (===) work pretty much same way, without attempting convert , b boolean, number or string, in first step. correct?

you can see image here too:

ok here real thing, matter of principles ;)

is flowchart correct?

no. should utilize ecmascript specification abstract equality comparing algorithm create flowchart. toboolean not first step (it's not used in any step).

or missing something?

yes, lot.

it's understanding identity operator (===) work pretty much same way, without attempting convert , b boolean, number or string, in first step. correct?

the strict equality comparing algorithm identical abstract equality comparing algorithm, there difference if argument types different, , in case there precise order in types made equal before comparing made.

javascript

No comments:

Post a Comment