Plain or literal objects : instances of Object class, made via {} notation.
Class objects are instances of classes, via class notation.
Property Descriptors describes a property via a flag object. Properties can be data or accessors
const flags = {
value : 'Mayank', writable : true, enumerable : true, configurable : true,
get() {},
set() {},
}
Object.defineProperty(obj, 'name', flags) //will overwrite
Object.defineProperties(obj, {name: flags})
Object.getOwnPropertyDescriptor(obj, 'name')
Object.getOwnPropertyDescriptors(obj)
//deep copy + circular references
structuredClone(obj)
//shallow copy [OBJECT COMPOSITION]
Object.assign({}, src1, src2, src3)
//copy symbols too
clonee = Object.defineProperties({}, Object.getOwnPropertyDescriptors(obj))
.protoype is hidden internal property accessed only via getPrototypeOf, setPrototypeOf
Constructor Functions
[[Construct]] method and .prototype propertyclass User : constructor is User and User.prototype is where properties shared are placed.new User() evaluates, constructor creates an empty object, set its prototype toUser.prototype , then executes with this set to object createdObject.prototype.__proto__ === null //this has no prototype