New course! Every coder should learn Generative AI!
Try a free lesson0
Javascript Object
How to add multiple object without using array object. (Suppose I wanna add some 10 employee details in array is it possible)
1 Answer
0
You can create arrays by using the square brackets [] . e.g.
arr=[‘one’,’two’,’three’]
then use the push method to add more items:
arr.push(‘four’)
just substitute the strings in the array with an object {}