JavaScript

Rest parameter

seoca 2020. 8. 26. 22:22

 

 

Use Rest parameter(...args) to allow accepting an indefinite number of arguments and store them in an array

 

const arrow = (...args) => {

    console.log(args);

}


arrow(1,2,3,4);

 

 

output

[1,2,3,4] - it returns array