Created
May 18, 2023 00:58
-
-
Save kironroy/b0ce17ea4c59bdc965b4e56c9323d6eb to your computer and use it in GitHub Desktop.
...REST
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
// functions REST | |
const add = function (...numbers) { | |
let sum = 0; | |
for (let i = 0; i < numbers.length; i++) sum += | |
numbers[i]; | |
console.log(sum); | |
}; | |
add(2, 3); | |
add(5, 6, 7, 8, 9); | |
add(1, 2, 3, 4, 5, 6, 7, 8, 9); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment