Closed steelbrain closed 8 years ago
Thank for the PR! Does apply
take an array as a first parameter? I always thought the array came second, after the this
value.
fn.apply([this, ...args, ...moreArgs]);
// vs
fn.apply(this, [...args, ...moreArgs]);
Good catch, fixed
Great, thanks!
Compiled output before
Compiled output after
Benefits: Instead of having to do
fn.call.apply(fn, ...args)
, we just directly dofn.apply(...args)