ZRTECH SOLUTIONS

Q. What is the object type?

The object type refers to a compound value where you can set properties (named locations) that each hold their own values of any type. Bracket notation is also useful if you want to access a property/key but the name is stored in another variable, such as:

How do you clone an object? Javascript object clone

Javascript object clone Now the value of objclone is {a: 1 ,b: 2} but points to a different object than obj. Note the potential pitfall, though: Object.assign() will just do a shallow copy, not a deep copy. This means that nested objects aren’t copied. They still refer to the same nested objects as the original: