Reflect

handler

  • get
  • set
  • Has (similar to In, can traverse the prototype chain)
  • apply
  • call
  • DefineProperty (to define the property and possibly refine the property description)
  • deleteProperty
  • IsExtensible (to determine whether it can be extended)
  • preventExtensions
  • GetPrototypeOf (read the prototype object)
  • SetPrototypeOf (set the prototype object)
  • OwnKeys (not including prototype chain, property array)
  • GetOwnPropertyDescriptor (obj, prop)[to get object description]
  • construct
  • Symbol(Symbol.toStringTag): “Reflect”

summary

Reflect has both methods and objects, but using Reflect is more concise and can avoid the problem that the Object is a vacuum Object with no method