” JavaScript Reflection and Reflect API “
Reflect.deleteProperty(target,name)
예제 소스코드
1 |
|
출력결과
1 |
|
Reflect.deleteProperty(target, name)
1 |
|
target
: first argument is the target/reference objectname
: second argument is the name of the property that you want to be removed
Reflect.set(target, name, value)
예제 소스코드
1 |
|
출력결과
1 |
|
예제 소스코드 (추가된 내용)
1 |
|
출력결과 (추가된 내용)
1 |
|
Reflect.set(target, name, value)
target
: first argument is the target/reference objectname
: second argument is the name of the object’s propertyreceiver
: third argument is the value of the property
Reflect.get(target, name, receiver)
예제 소스코드 1
1 |
|
출력결과 1
1 |
|
Reflect.get(computer1, "processor");
출력결과
1 |
|
console.log(computer1); Reflect.get(computer1, "processor");
출력결과
1 |
|
Reflect.get(computer1, "processor"); console.log(computer1.processor);
1 |
|
예제 소스코드 2
1 |
|
출력결과 2
1 |
|
Reflect.get(target, name, receiver)
target
: first argument is the target/reference objectname
: second argument object’s property namereceiver
: third argument is the receiver
링크
https://www.codeproject.com/Articles/5275933/JavaScript-Reflection-and-Reflect-API