-
-
Save QuocCao-dev/d01c7ddb9df233cd32a089136df8248d to your computer and use it in GitHub Desktop.
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
| function showItems(arg1, arg2, arg3) { | |
| var arr = [arg2, arg3].concat(arg1); | |
| console.log(arr); | |
| } | |
| showItems(["dogs", "cats"], "turtles", "sharks"); | |
function showItems(arg1, ...args) {
console.log([...arg1, ...args]);
}
showItems(["dogs", "cats"], "turtles", "sharks");
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function showItems(arg1, ...arr) {
var arr = [...arr, ...arg1]
console.log(arr);
}