Created
September 23, 2020 13:52
-
-
Save alisaliso/2e53c55880b8cf4941adcba753b3e8a9 to your computer and use it in GitHub Desktop.
ReactJS Developer komoot 2
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
// Double input with non-arrow function and it's arguments object | |
function doubleNumbers() { | |
return [...arguments].map((a) => a * 2); | |
} | |
// or with arrow function and destructured parameters | |
const doubleNumbers = (...args) => { | |
return args.map((a) => a * 2); | |
}; | |
// or with function declaration and destructured parameters | |
function doubleNumbers(...args) { | |
return args.map((a) => a * 2); | |
}; | |
console.log(doubleNumbers(1, 2, 3)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment