Reputation: 5
AM new to JSON and was thinking if i will be able to store an array of values to one among the keys in my JSON object?
like {"a","e","i","o","u"} to a key called vowels?
Upvotes: 0
Views: 55
Reputation: 201
Yes, what about:
var chars = {vowels : ["a", "o", "u", "i", "e"]};
Now, you access the vowels via
chars.vowels
Note, that an array is defined using [ ] in JS.
Upvotes: 3