From 2fd30d768daf679ca928a1748010ba7eacdd9143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AE=87=E8=BE=89?= <2696103916@qq.com> Date: Fri, 15 Dec 2023 04:45:51 +0000 Subject: [PATCH] =?UTF-8?q?=E9=99=88=E5=AE=87=E8=BE=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈宇辉 <2696103916@qq.com> --- ...14\346\200\273\345\244\215\344\271\240.md" | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 "59\351\231\210\345\256\207\350\276\211/\351\231\210\345\256\207\350\276\211202312014\346\200\273\345\244\215\344\271\240.md" diff --git "a/59\351\231\210\345\256\207\350\276\211/\351\231\210\345\256\207\350\276\211202312014\346\200\273\345\244\215\344\271\240.md" "b/59\351\231\210\345\256\207\350\276\211/\351\231\210\345\256\207\350\276\211202312014\346\200\273\345\244\215\344\271\240.md" new file mode 100644 index 0000000..961a1e1 --- /dev/null +++ "b/59\351\231\210\345\256\207\350\276\211/\351\231\210\345\256\207\350\276\211202312014\346\200\273\345\244\215\344\271\240.md" @@ -0,0 +1,25 @@ +## 笔记 + + +````js +Reflect.apply( + Math.floor, // 目标函数,要调用哪个函数(必写) + null, // 调用函数时绑定的this对象(可选) + [1.31] // 目标函数调用是传入的实参列表,一般是一个类数组的对象(可选) +) + + +Reflect.set(obj, 'name', '李四') // 返回T|F + +const price = 100.2 +Reflect.apply(price > 100 ? Math.floor : Math.ceil, null, [price]) // 100 + + +const date = Reflect.construct( + Date, // 被运行的目标函数(必写) + []) // 调用构造函数的数组或伪数组(可选) +console.log(date.getTime()); +```` + + + -- Gitee