Skip to content

Instantly share code, notes, and snippets.

@nifrasismail
Created July 30, 2020 10:36
Show Gist options
  • Save nifrasismail/0354e7bfe2994ff2c2f6e818c19d1477 to your computer and use it in GitHub Desktop.
Save nifrasismail/0354e7bfe2994ff2c2f6e818c19d1477 to your computer and use it in GitHub Desktop.
//we have a function to accept arguments and return it.
const toArray = (arg1,arg2,arg3) => {
return [arg1,arg2,arg3];
};
/**
* now what we need to do it to make the function for to accept
* multiple number of arguments.
*/
const toArray = (...args) => {
return args;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment