I'm trying to output the keys of an array in javascript like this:
data=[8, 4, 6, 9, 5, 2, 4, 6];
for(i in data){console.log(i);}
But instead of only outputting the keys, it outputs this:
0
1
2
3
4
5
6
7
$family
each
clean
associate
link
contains
extend
getLast
getRandom
include
combine
erase
empty
flatten
hexToRgb
rgbToHex
min
max
average
sum
unique
shuffle
Why? And how can I make it stop after outputting the array keys?