function with unknown number of arguments javascript code example
Example: Pass unknown number of arguments into javascript function
var print_names = function(...names) {
for (let i=0; i<names.length; i++) console.log(names[i]);
}
var print_names = function(...names) {
for (let i=0; i<names.length; i++) console.log(names[i]);
}