Skip to content

Instantly share code, notes, and snippets.

@QuocCao-dev
Created September 24, 2022 10:03
Show Gist options
  • Save QuocCao-dev/d01c7ddb9df233cd32a089136df8248d to your computer and use it in GitHub Desktop.
Save QuocCao-dev/d01c7ddb9df233cd32a089136df8248d to your computer and use it in GitHub Desktop.
function showItems(arg1, arg2, arg3) {
var arr = [arg2, arg3].concat(arg1);
console.log(arr);
}
showItems(["dogs", "cats"], "turtles", "sharks");
@Merce0897
Copy link

function showItems(arg1, ...arr) {
var arr = [...arr, ...arg1]
console.log(arr);
}

@NhanKhangg98
Copy link

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