JS Built-ins
Reflectapplyintermediate

Reflect.apply() - String.prototype.includes

πŸ“– Usage Example
const result = Reflect.apply(Math.max, null, [1, 5, 3])
console.log(result) // β†’ 5
// Equivalent to: Math.max.apply(null, [1, 5, 3])

Reflect.apply() calls a function with a given this value and arguments array, similar to Function.prototype.apply.

Invoke string prototype methods via Reflect.apply.

πŸ’‘ Hints (1)
  • β€’ Pass the string as thisArg so that this inside includes refers to it.