Back to Browse

Program 10 Const object mutation | JS Interview Questions | Object mutation

79 views
Apr 6, 2023
2:34

const a = {}; a.name = "Trints tech"; In this program, we create an empty object using the object literal syntax. Then, we add a new property to a called name and assign it the string value "Trints tech" using dot notation. When we log a to the console, we see that it now has a single property called name with the value "Trints tech". When we log a.name to the console, we see that it logs the value of the name property, which is "Trints tech".

Download

0 formats

No download links available.

Program 10 Const object mutation | JS Interview Questions | Object mutation | NatokHD