DEV Community

Cover image for //Objects in JavaScript//
QUBE
QUBE

Posted on

//Objects in JavaScript//

An object is a dynamic data structure that stores related data as key-value pairs, where each key uniquely identifies its value.

  • The values of properties can be primitives, objects, or functions (known as methods when defined inside an object).

  • Objects are mutable and dynamic properties can be added, modified, or deleted at any time.

  • Objects allow data grouping and encapsulation, making it easier to manage related information and behaviour together.

1. Creating Object Using Object Literal

  • The object literal syntax allows you to define and initialize an object with curly braces {}, setting properties as key-value pairs.

2.Basic Operations on JavaScript Objects

CRUD Operations in Objects

Creating an Object in JavaScript:

Read through Objects:

Updating Values in Objects:

Deleting Values in Objects:

References:

Objects in JavaScript - GeeksforGeeks

Your All-in-One Learning Portal: GeeksforGeeks is a comprehensive educational platform that empowers learners across domains-spanning computer science and programming, school education, upskilling, commerce, software tools, competitive exams, and more.

favicon geeksforgeeks.org

Top comments (0)