- I see the node.
 -  
Comparison in both cases is successful
 -  
Which is correct And should it be used?
 - Please argue with my limited understanding.
 
I have such a code
  if (['code'] == '11000') {console.log ("single quote string") ; } If (['code'] == 11000) {console.log ("with single quote"); }   Output is:
  Single bid with single quote string   
 You should always use 'strict similarity' checks in javascript, which is three equal:  ===  instead of  = =  
 When you use  == , for the purpose of operation Javascript will take the liberty to cast for you type strings and corresponding comparison That in this way, fake values, etc. You should never use  ==  for any reason. 
More examples:
  null == undefined; // true  
  null === undefined; // false  
No comments:
Post a Comment