Baseline Widely available
Reflect.apply()
ì ì ë©ìëë ëì í¨ì를 주ì´ì§ 매ê°ë³ìë¡ í¸ì¶í©ëë¤.
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"
구문
Reflect.apply(target, thisArgument, argumentsList);
매ê°ë³ì
target
í¸ì¶í ëì í¨ì.
thisArgument
í¸ì¶ìì target
ì this
ë¡ ì¬ì©í ê°.
argumentsList
target
ì í¸ì¶í ë 매ê°ë³ìë¡ ì ë¬í ë°°ì´í ê°ì²´.
주ì´ì§ this
ê°ê³¼ 매ê°ë³ìë¡ ëì í¨ì를 í¸ì¶í ê²°ê³¼.
target
ì´ í¸ì¶ ê°ë¥í ê°ì²´ê° ìëë©´ TypeError
.
ES5ììë Function.prototype.apply()
ë©ìë를 ì¬ì©í´, í¨ì를 í¸ì¶í ë this
ê°ì ì§ì íê±°ë 매ê°ë³ì를 ë°°ì´(ëë ë°°ì´í ê°ì²´)ìì ëê²¨ì¤ ì ìììµëë¤.
Function.prototype.apply.call(Math.floor, undefined, [1.75]);
Reflect.apply()
ë©ìë를 ì¬ì©í´ ê°ì ìì
ì ë ì½ê³ ì ë ¤íê² ìíí ì ììµëë¤.
Reflect.apply()
ì¬ì©í기
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"
ëª
ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4