Skip to content

Instantly share code, notes, and snippets.

@ericelliott
Created June 26, 2020 22:04
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 ericelliott/b999973a7fd3963857f0edceb7732fd9 to your computer and use it in GitHub Desktop.
Save ericelliott/b999973a7fd3963857f0edceb7732fd9 to your computer and use it in GitHub Desktop.
double-list-imperative.js
const doubleList = list => {
const newList = [];
for (var i = 0; i < list.length; i++) {
newList[i] = list[i] * 2;
}
return newList;
};
@pablopaul
Copy link

@ericelliot why using var over let in line 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment