Skip to content

Instantly share code, notes, and snippets.

@flexaddicted
Created January 26, 2019 16:48
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 flexaddicted/a4819c10d7b977a99bec5e56e9ae5880 to your computer and use it in GitHub Desktop.
Save flexaddicted/a4819c10d7b977a99bec5e56e9ae5880 to your computer and use it in GitHub Desktop.
function myMap2(numbers) {
const elements = [];
for(let i = 0; i < numbers.length; i++) {
elements.push(numbers[i] * 2);
}
return elements;
}
const doubles = myMap2([1, 2, 3, 4]);
console.log(doubles);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment