Skip to content
Advertisement

Size of object array is being added to the localstorage not the array of objects

JavaScript

When I am Uploading the data to the localStorage I am getting the size of object array that I have created instead of the array with data object

Advertisement

Answer

Javascript array function push returns the new length of the array. You need to push and setItem like belows.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement