标签云

微信群

扫码加入我们

WeChat QR Code

在JavaScript中= =,= = =之间的区别是什么?[重复]

Possible Duplicate:
Javascript === vs == : Does it matter which “equal” operator I use?
When would JavaScript == make more sense than ===?

What is the difference between below methods in comparing a string with undefined value.

 var x; 
 if(x==undefined) 
 { 
  alert(x); 
 }

and

if(x===undefined)
{ 
  alert(x); 
}

Why should i prefer second method in this case.. Please let me know advantages..


Dup: stackoverflow.com/questions/2132878/…

2018年05月23日59分10秒

deceze Scenarios are different...

2018年05月23日59分10秒

user stackoverflow.com/questions/776950/… then.

2018年05月24日59分10秒