Objects
Explore the fundamentals of JavaScript objects by learning about key-value pairs, property and method slots, and different use cases such as records, maps, namespaces, and typed objects. Understand how to access and create objects without classes to build flexible front-end applications.
We'll cover the following...
What is an object?
A JavaScript object is essentially a set of key-value pairs, also called slots. In these key-value pairs names can be property names, function names, or keys of a map. JavaScript objects are different from classical object-oriented or Unified Modeling Language (UML) objects. In particular, they don’t have to instantiate a class, and they can have their own instance-level methods. That way, they not only have ordinary property slots, but method slots as well. In addition, JS objects may also have key-value slots. So, these objects may have three different kinds of slots, while classical objects (called instance ...