JavaScript: Difference between revisions

Content deleted Content added
Fixed syntax in the JS, it was missing a few ";"
Simple examples: fix unintended global
Line 157:
<syntaxhighlight lang="javascript">
function sum() {
var i, x = 0;
x = 0;
for (i = 0; i < arguments.length; ++i) {
x += arguments[i];