Skip to content

Instantly share code, notes, and snippets.

@jackpordi
Created September 11, 2019 21:33
Show Gist options
  • Save jackpordi/ba47561686a2ba97659956b51fa6120f to your computer and use it in GitHub Desktop.
Save jackpordi/ba47561686a2ba97659956b51fa6120f to your computer and use it in GitHub Desktop.
function myMap(list, func) {
output = [];
for (var i=0; i<list.length; i++){
output.push(
func(list[i])
);
}
return output;
}
mappedList = myMap([1,2,3,4], timesTwo);
console.log(mappedList);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment