This section provides a JavaScript tutorial example on using arithmetic, comparison, bitwise, and assignment operators.
Based on the description of operators and expressions given in the previous section,
here is a JavaScript tutorial example that shows you different types of operators:
<html>
<!-- Operators.html
Copyright (c) 2008 by Dr. Herong Yang, http://www.herongyang.com/
-->
<head><title>Operators and Expressions</title></head>
<body>
<pre>
<script type="text/javascript">
document.write(10/3);
document.write('\n');
document.write(10%3);
document.write('\n');
document.write(1>0);
document.write('\n');
document.write('Five'>'One');
document.write('\n');
document.write(10=='10');
document.write('\n');
document.write(10==='10');
document.write('\n');
document.write(1<<3);
document.write('\n');
document.write(8>>3);
document.write('\n');
var comment;
document.write(comment='Assignment is expression');
document.write('\n');
</script>
</pre>
</body>
</html>