Objects are the general building block upon which much of JavaScript is built. If you are new to JavaScript then I suggest you understand this terminology as much as possible. Objects are one of the primitive data types in JavaScript and can be defined as a collection of key-value pairs. An object can be created as follows:

// "object literal" syntax
let user = {
    name: 'Nishla'
};
// "object constructor" syntax
let user1 = new Object({
    name: 'Nishla'
});

After creating each object, it inherits an internal property known as the protoItis simply a reference to another object and contains common attributes/properties across all instances of the Object. This might sound a bit confusing to have an object inside another object as a reference but here’s how you can be clarified: _Both the objects that we created _user_ and user1 will have a property proto which is exactly the same and will be present in all the objects that we create_

#javascript #web-development #coding #programming #objects

The Basics of Object Prototype and Prototypal Inheritance
1.90 GEEK