Created
July 13, 2016 16:43
-
-
Save LookOnTheBrightSide/d01e429a15aafc0c2a1a8178f889a193 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [2, 3, 4, 5, 6, 7]; | |
let reducer = (...nums) => nums.reduce((prev, next) => prev + next) | |
let total = reducer(numbers) | |
console.log(`Your lucky number is: ${reducer(1,2,3) + 10}`) | |
console.log(`The total is ${total}`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why do I get an array back when I pass in numbers variable? Am I missing something?