Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
const imperativeDouble = numbers => {
const doubled = []
for (i = 0; i < numbers.length; i++) {
doubled.push(numbers[i] * 2)
}
return doubled;
}
const declarativeDouble = numbers => numbers.map(n => n * 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment