๐Reflect
Last updated
Last updated
JS โฉ object โฉ built-in โฉ Reflect
A built-in object that provides methods for interceptable operations. The methods are the same as those of proxy handlers.
Reflect is not a function object, so it's not constructible
the first parameter to all the Reflect methods is called the target parameter.
(f, o, args)
invokes f
as a method of o
, just like o.f(args)
.
same as f.apply(o, args)
.
(C, args, newTarget)
invokes C
as a constructor.
same as new C(...args)
.
newTarget
is used as (if specified).
(o, key, desc)
define new/existing property.
similar to (o, key, desc).
but returns boolean.
(o, key)
delete a property.
similar to delete o[key]
.
returns boolean.
(o, key, receiver)
get a property.
similar to o[key]
.
( what the receiver
is for. )
(o, key)
get a .
(almost) same as (o, key)
(o)
get the of an object.
(almost) same as (o).
(o, key)
check if object o
has property key
.
similar to key in o
.
returns true
for any inherited properties.
(o)
check if an object is extensible.
() same as (o)
(o)
returns an array of own property keys. (string/symbol included)
similar to (o) + (o).
(o)
prevents new properties from being added to an object.
() same as (o)
(o, key, value, receiver)
set a property.
similar to o[key] = value
.
returns boolean.
(not sure what the is for )
(o, p)
set the of an object. (not recommended)
similar to (o, p).
returns boolean.