Return to Kroll Design home page

JavaScript Tutorials

 
« Return

equality operator ==

The equality operator consists of two equal signs: ==
It returns true if the two things being compared evaluate to the same value.
Don't confuse it with the assignment operator, which consists of one equal sign: =

Code:

<script type="text/javascript">
//<![CDATA[
a = 2;
b = 2;
c = 5;
document.write("a == b : ", a==b, "<br />");
document.write("b == c : ", b==c, "<br />");
//]]>
</script>

Output:



 
« Return


©2012 Kroll Design    info@KrollDesign.net    781.910.3694
Last modified: 12/31/1969 7:00 PM