I am getting a dictionary from an online api in the form of {{key: object}, {key: object},... For like 1000 Objects}. I would like to use reactJS to do something like
"Dictionaries" in Javascript are called objects and you can iterate over them in a very similar way to arrays.
var dict = this.props.dict;
for (var key in dict) {
// Do stuff. ex: console.log(dict[key])
}
If you were thinking of using map so that at the end of the iteration you had a complete array, then inside your for..in
loop you could push to an array you declare earlier.
var dict = this.props.dict;
var arr = [];
for (var key in dict) {
arr.push(dict[key]);
}