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

Reflect.apply() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

Reflect.apply()

Baseline

20169

Reflect.apply()

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

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

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

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

js
Reflect.apply(target, thisArgument, argumentsList)

target

thisArgument

target this

argumentsList

target

target

TypeError

target argumentsList

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

js
Math.floor.apply(null, [1.75]);
Reflect.apply(Math.floor, null, [1.75]);

  • Reflect.apply() this target
  • Reflect.apply() argumentsList

Reflect.apply() target [[Call]]

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"

ECMAScript 2027 LanguageSpecification
# sec-reflect.apply


Web Proxy Viewer  |  New URL  |  Original Page