I have the following object (called message_tags):
{
"88": [
{
"id":"864794113531613",
"name":"Luis Angel Rodriguez",
"type":"user",
"offset":88,
"length":20
}
],
"112": [
{
"id":"640891773501",
"name":"Carl Champion Jr.",
"type":"user",
"offset":112,
"length":17
}
]
}
I can get values from it using something like this:
var id = message_tags[88][0].id
but where it says 88
and 112
will always be different numbers, and the only way I can tell what number it will be is by getting the offset, which of course if further inside the object.
How can I iterate through this object not knowing what those numbers can be? (can't use message_tags[0]
as it returns undefined