I have an array in JavaScript like this
var arr = [];
arr['5u'] = 250;
arr['1u'] = 120;
arr['7u'] = 670;
arr['2u'] = 210; //<-----
arr['9u'] = 850; //<-----
arr['8u'] = 129; //<-----
arr['3u'] = 382;
arr['6u'] = 391;
arr['4u'] = 432;
I want to get only 3 elements starting from index of 3 to 5 in above array. How can I get so? the result should be something like this.
[210,850,129];
I tried accessing it as arr[3] and off-course as it should it is showing undefined. Now how can I get so?
I want to access values with loop like this
for(var i=3; i<6; i++)
{
console.log(arr[i]);
}