js_sys

Module Reflect

Source

Functions§

  • The static Reflect.apply() method calls a target function with arguments as specified.
  • The static Reflect.construct() method acts like the new operator, but as a function. It is equivalent to calling new target(...args). It gives also the added option to specify a different prototype.
  • The static Reflect.construct() method acts like the new operator, but as a function. It is equivalent to calling new target(...args). It gives also the added option to specify a different prototype.
  • The static Reflect.defineProperty() method is like Object.defineProperty() but returns a Boolean.
  • The static Reflect.deleteProperty() method allows to delete properties. It is like the delete operator as a function.
  • The static Reflect.get() method works like getting a property from an object (target[propertyKey]) as a function.
  • The same as get except the key is an f64, which is slightly faster.
  • The static Reflect.getOwnPropertyDescriptor() method is similar to Object.getOwnPropertyDescriptor(). It returns a property descriptor of the given property if it exists on the object, undefined otherwise.
  • The static Reflect.getPrototypeOf() method is almost the same method as Object.getPrototypeOf(). It returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object.
  • The same as get except the key is a u32, which is slightly faster.
  • The static Reflect.has() method works like the in operator as a function.
  • The static Reflect.isExtensible() method determines if an object is extensible (whether it can have new properties added to it). It is similar to Object.isExtensible(), but with some differences.
  • The static Reflect.ownKeys() method returns an array of the target object’s own property keys.
  • The static Reflect.preventExtensions() method prevents new properties from ever being added to an object (i.e. prevents future extensions to the object). It is similar to Object.preventExtensions(), but with some differences.
  • The static Reflect.set() method works like setting a property on an object.
  • The same as set except the key is an f64, which is slightly faster.
  • The static Reflect.setPrototypeOf() method is the same method as Object.setPrototypeOf(). It sets the prototype (i.e., the internal [[Prototype]] property) of a specified object to another object or to null.
  • The same as set except the key is a u32, which is slightly faster.
  • The static Reflect.set() method works like setting a property on an object.