I have an array in which I added 3 data in different indices as shown below
var a=[];
a[1]=4;
a[3]=7;
a[4]=8;
now my array will look like this
a=[undefined, 4, undefined, 7, 8, undefined]
I want to extract a value from an array and add it to another array. is there any simplest way i can use it. Until now, I am taking a value using the "for" loop, it is normal when I have a small amount of data. here I need only 3 values, but the loop runs for 6 times.
Thank you in advance
source
share