from
"data":[{"ja":"大阪市"},{"en":"Osaka"}]
I want to get "ja" and "en".
I tried several ways...
data.map(function(_, i) { return i; });
it returns array of numbers.
console.log(Object.keys(Object.values(data)));
all trials return
(2) [0, 1]
0: 0
1: 1
what can I do ?? please answer me. thank you.
data.map(x => Object.keys(x)[0])Bad JSON design though. Would make far more sense if both keys and values just belonged to the same object.[0]is that, as I stated, your JSON is badly designed.