DEV Community

Discussion on: Spread Operator Tricks

Collapse
 
kepta profile image
Kushan Joshi

The most important use case of rest is

const wrapper = (...args) => someFunc.apply(null, args)

You donโ€™t have resort to using weird hacks to slice the argument object anymore, to apply the args to another function.

Collapse
 
robaguilera profile image
Robert Aguilera

Definitely! I just personally haven't come across needing to do that. Only time I ever needed to mess with the argument object was to log it out to see what was being passed in.