Skip to content

Commit

Permalink
Merge pull request #102 from GuoXiCheng/dev-c
Browse files Browse the repository at this point in the history
add reflect md
  • Loading branch information
GuoXiCheng authored Jul 22, 2024
2 parents c9537e1 + ac205ff commit 5732530
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/.vitepress/sidebars/ecma-script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@
link: /javascript/ecma-script/proxy-and-reflect/proxy#创建代理
- text: 创建可撤销代理
link: /javascript/ecma-script/proxy-and-reflect/proxy#创建可撤销代理
- text: 反射
link: /javascript/ecma-script/proxy-and-reflect/reflect
items:
- text: 什么是反射
link: /javascript/ecma-script/proxy-and-reflect/reflect#什么是反射
- text: 直接使用反射
link: /javascript/ecma-script/proxy-and-reflect/reflect#直接使用反射
- text: 代理捕获器中使用反射
link: /javascript/ecma-script/proxy-and-reflect/reflect#代理捕获器中使用反射
- text: 模块
collapsed: true
items:
Expand Down
19 changes: 19 additions & 0 deletions src/javascript/ecma-script/proxy-and-reflect/reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 反射

## 什么是反射

反射是一个内置的全局对象,它提供了一些与操作对象相关的静态方法,这些方法与代理捕获器的方法一一对应。

::: info
反射方法并不局限于代理捕获器中使用。

大多数的反射方法在 Object 上也有对应的方法,反射方法适用于细粒度的对象控制与操作。
:::

## 直接使用反射

<<< @/../projects/javascript-sandbox/src/proxy-and-reflect/reflect.ts#direct-use-reflect

## 代理捕获器中使用反射

<<< @/../projects/javascript-sandbox/src/proxy-and-reflect/reflect.ts#use-reflect-in-proxy-handler

0 comments on commit 5732530

Please sign in to comment.