Skip to content

Instantly share code, notes, and snippets.

@ruxandrafed
Last active October 5, 2015 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruxandrafed/cb8cecf302f445d6728d to your computer and use it in GitHub Desktop.
Save ruxandrafed/cb8cecf302f445d6728d to your computer and use it in GitHub Desktop.
arrayOfLight (JS exercise)
function arrayOfLight(no) {
array = [];
for (i=0; i<=no; i++) {
array.push(i);
};
return array;
};
no = prompt('Give me a number:');
console.log(arrayOfLight(no));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment