Proxy和Reflect

Proxy代理##

get


Proxy和Reflect_第1张图片
image.png

set


Proxy和Reflect_第2张图片
image.png

has
Proxy和Reflect_第3张图片
image.png
Proxy和Reflect_第4张图片
image.png

delete

Proxy和Reflect_第5张图片
image.png
image.png

结果


image.png

ownKeys


own

结果
image.png

Reflect##

Reflect和Rroxy有相同的方法,且用法一致

Proxy和Reflect_第6张图片
image.png

实例##

Proxy和Reflect_第7张图片
image.png

!!类型转换 将对应的类型转换为boolean型

Proxy和Reflect_第8张图片
image.png

你可能感兴趣的:(Proxy和Reflect)