“我想区分json对象和javascript中的数组。”
****************************************************** ************************
例如:data = {“ 1”:2,
“ 2”:[1,32,4],
“ 3”:{“ x”:“ y”},
“ 4”:[{“ q”:“ w”},{“ a”:“ s”},{“ z”:“ x”}],
“ 5”:true}
data['2'] and data['3'] both are object,
typeof(data['2']) -- object
typeof(data['3']) -- object
Even if i try to iterate over items to check which has key value using for loop.
for item in data['2']-- return index 012(as string)
for item in data['3']-- return keys(as string)