How can I initialise an object in JavaScript, the properties of which would be arrays? I want to have an object of this format: My usecase is the following: – When a property does not exist, create this property which should be an array and add a number. – When a property exists already, push the number to that array;
Tag: initialization
How to initialise array in react-native using es6?
I am trying to create empty array in react-native using es6. But while accessing it I get an error data not defined. Here is the code snippet which I am using to initialise the array. Here is the code through which I am trying to populate the array and at the same time logging it I think so there is