Skip to main content

Command Palette

Search for a command to run...

Important Object Methods

Published
•1 min read•View as Markdown
  1. Object.keys()

    • Returns the Keys of an object in an ARRAY
  2. Object.values()

    • Returns the values of an object in an ARRAY
  3. For both Object.keys() and Object.values(), the argument passed is the object you want the values or keys for.

  4. Object.assign()

    • This copies the properties of 1 or more object sources to a target object.

    • Syntax = Object.assign(target, ...sources)

      • The target is the object being acted on

      • the sources are the objects containing the properties to be added.

      • It returns the target object

      • If no target is given, it will copy the source object

Citations:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object

More from this blog

Romil's Technical Blog

14 posts