/* * This is a JavaScript Scratchpad. * * Enter some JavaScript, then Right Click or choose from the Execute Menu: * 1. Run to evaluate the selected text (Ctrl+R), * 2. Inspect to bring up an Object Inspector on the result (Ctrl+I), or, * 3. Display to insert the result in a comment after the selection. (Ctrl+L) */ //function countdown() { var countdown = function (start) { var list=""; // generate string of numbers from 10 to 0 for (var i=start; i>0; i--) { list += (i + " "); } return list; } countdown var alias=countdown; alias(7); alias(8); /* 8 7 6 5 4 3 2 1 *//* 7 6 5 4 3 2 1 */ alias = 7; /* 10 9 8 7 6 5 4 3 2 1 */ /* function countdown() { var list=""; // generate string of numbers from 10 to 0 for (var i=10; i>0; i--) { list += (i + " "); } } */ countdown(); /* 10 9 8 7 6 5 4 3 2 1 */ /* 10 9 8 7 6 5 4 3 2 1 */ /* undefined */ function countdown() {} function plus(x,y) { return x+y; } plus(1,2); /* 3 */