Does anyone know how to get the variable names in the array? For example, [a, b, c] wants to get the values of a, b, c and a, b, c respectively by traversing.
曾经蜡笔没有小新2017-07-05 10:37:51
> arr=[]
> arr['a']=1
> arr['b']=2
> arr['c']=3
> for(k in arr)console.log(k,arr[k])
a 1
b 2
c 3
> arr
[ a: 1, b: 2, c: 3 ]