Working with the Increment Operator : Operator « Language Basics « JavaScript DHTML
- JavaScript DHTML
- Language Basics
- Operator
Working with the Increment Operator
<HTML>
<BODY>
<H1>
<SCRIPT>
var Inc = 1;
document.write("Starting value of " + Inc + "<BR>");
document.write("IncPreFix " + ++Inc + "<BR>");
document.write("IncPostFix " + Inc++ + "<BR>");
document.write("Ending value of " + Inc);
</script>
</H1>
</BODY>
</HTML>
Related examples in the same category