[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Reflect/apply [Back]  [Original]

Reflect.apply() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Reflect.apply()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2016 9.

Reflect.apply() .

In this article

console.log(Reflect.apply(Math.floor, undefined, [1.75]));
// Expected output: 1

console.log(
  Reflect.apply(String.fromCharCode, undefined, [104, 101, 108, 108, 111]),
);
// Expected output: "hello"

console.log(
  Reflect.apply(RegExp.prototype.exec, /ab/, ["confabulation"]).index,
);
// Expected output: 4

console.log(Reflect.apply("".charAt, "ponies", [3]));
// Expected output: "i"

js
Reflect.apply(target, thisArgument, argumentsList);

target

.

thisArgument

target this .

argumentsList

target .

this .

target TypeError.

ES5 Function.prototype.apply() , this ( ) .

js
Function.prototype.apply.call(Math.floor, undefined, [1.75]);

Reflect.apply() .

Reflect.apply()

js
Reflect.apply(Math.floor, undefined, [1.75]);
// 1;

Reflect.apply(String.fromCharCode, undefined, [104, 101, 108, 108, 111]);
// "hello"

Reflect.apply(RegExp.prototype.exec, /ab/, ["confabulation"]).index;
// 4

Reflect.apply("".charAt, "ponies", [3]);
// "i"

Specification
ECMAScript 2027 LanguageSpecification
# sec-reflect.apply


Web Proxy Viewer  |  New URL  |  Original Page