how to add infinite arguments in a function in javascript code example
Example: node js function infinite parameters
function print(...args) {
args.forEach((arg, index) => {
console.log(arg);
});
}
print('hello', true, new Date());
function print(...args) {
args.forEach((arg, index) => {
console.log(arg);
});
}
print('hello', true, new Date());