Last active
November 28, 2018 13:27
-
-
Save Yago/fd0da8e12d8e25280f826adf826ab532 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
const sum = function sum() { | |
return [...arguments].reduce(function (acc, n) { | |
if (typeof n === 'number') return acc + n; | |
return acc; | |
}, 0); | |
} | |
sum(31,7,4); // return 42 | |
// For recursion | |
person.communication.capabilities.greetings = greetings() { | |
console.log('Hello you ! ❤️'); | |
greetings(); // Infinite greetings, yay ! | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment