From 9d9ca7e1164763b0b1038ca864389b23398935ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=BE=89?= <11764079+elrianode@user.noreply.gitee.com> Date: Sun, 17 Dec 2023 02:47:26 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张辉 <11764079+elrianode@user.noreply.gitee.com> --- .../20231214 \345\244\215\344\271\240.md" | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 "01 \345\274\240\350\276\211/20231214 \345\244\215\344\271\240.md" diff --git "a/01 \345\274\240\350\276\211/20231214 \345\244\215\344\271\240.md" "b/01 \345\274\240\350\276\211/20231214 \345\244\215\344\271\240.md" new file mode 100644 index 0000000..12deb66 --- /dev/null +++ "b/01 \345\274\240\350\276\211/20231214 \345\244\215\344\271\240.md" @@ -0,0 +1,19 @@ +# 笔记 + +```js +Reflect.apply( + Math.floor, // 目标函数,要调用哪个函数(必写) + null, // 调用函数时绑定的this对象(可选) + [1.31] // 目标函数调用是传入的实参列表,一般是一个类数组的对象(可选) +) + +Reflect.set(obj, 'name', '李四') // 返回true|false + +const price = 100.2 +Reflect.apply(price > 100 ? Math.floor : Math.ceil, null, [price]) // 100 + +const date = Reflect.construct( + Date, // 被运行的目标函数(必写) + []) // 调用构造函数的数组或伪数组(可选) +console.log(date.getTime()); +``` \ No newline at end of file -- Gitee