Reflect.apply
calls a target function
it is a static method
the 1st parameter
is a callable, e.g. a function
passing it a non-callable throws a TypeError
the 2nd parameter
is the scope (or the this
)
the 3rd parameter
must be an array (or array-like)
is an array of parameters passed to the call
example usages
simple function call
call a function on an array
pass in the this
that the function to call needs
Links
How this function is specified.
How the 3rd parameter gets processed, as an `CreateListFromArrayLike`.
The MDN docs for this function.
Announcement of this kata on twitter.
Required Knowledge
- basics (Arrow functions)
- `let` declaration (Block scope)
- `const` declaration (Block scope)
- creation (Class)
- `array.fill()` (Array API)
Related Katas
Reflect
- basics
Reflect.apply()
Reflect.getPrototypeOf()
Reflect.construct()
Reflect.defineProperty()
Difficulty Level
INTERMEDIATE
First Published
3 July 2015
Stats
9 tests to solve