Created
November 24, 2021 18:23
-
-
Save catwhocode/dd8b7c385afc75a5aab01316789998ef to your computer and use it in GitHub Desktop.
Using Javascript Three Dots As Rest Arguments
This file contains hidden or 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
// source: | |
// https://dev.to/sagar/three-dots---in-javascript-26ci | |
function myFunc(a, b, ...args) { | |
console.log(a); // 22 | |
console.log(b); // 98 | |
console.log(args); // [43, 3, 26] | |
}; | |
myFunc(22, 98, 43, 3, 26); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment