How to assign values to an array with null/empty objects in JavaScript?



Following is the code to assign values to an array with null/empty objects using JavaScript −

Example

 Live Demo






Document



Assign values to an array with null/empty objects

Click on the above button to assign values to empty object inside arrObj

Output

The above code will produce the following output −

On clicking the ‘CLICK HERE’ button and inspecting the output in console −

Updated on: 2020-07-21T07:24:10+05:30

880 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements