The two operands are compared and Boolean false is returned if both values are equal, and of the same type, otherwise Boolean true is returned.
The associativity is from left to right.
Refer to the Operator Precedence topic for details of execution order.
<HTML> <HEAD></HEAD> <BODY> <SCRIPT> myObject1 = 100; myObject2 = "100"; if(myObject1 != myObject2) { document.write("Objects are NOT equal<BR>"); } else { document.write("Objects are equal<BR>"); } if(myObject1 !== myObject2) { document.write("Objects are NOT identical<BR>"); } else { document.write("Objects are identical<BR>"); } </SCRIPT> </BODY> </HTML>
Prev | Home | Next |
NOT Equal to (!=) | Up | Notation object |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |