Struggling with extracting numbers from a nested array in a JSON file and matching them with values in another array? Need to send the matched values to another function but can't seem to figure it out after two days of trying. Any advice or assistance would be greatly appreciated.
For reference, here is the data from my json:
{
"videos": [
{
"id": 1,
"title": "Lego!",
"created": 1509804047011,
"duration": 5,
"poster": "./videos/small.png",
"video": "./videos/small.mp4"
},
{
"id": 2,
"title": "Big Bunny",
"created": 1507804047011,
"duration": 62,
"poster": "./videos/bunny.png",
"video": "./videos/bunny.mp4"
},
{
"id": 3,
"title": "Prufu myndband",
"created": 1505904047011,
"duration": 3600,
"poster": "./videos/16-9.png",
"video": "./videos/bunny.mp4"
},
{
"id": 4,
"title": "Prufu myndband með löngum texta sem fer í tvær línur",
"created": 1504904047011,
"duration": 220,
"poster": "./videos/16-9.png",
"video": "./videos/bunny.mp4"
}
],
"categories": [
{
"title": "New videos",
"videos": [1, 2]
},
{
"title": "Amazing videos",
"videos": [1, 3, 4]
},
{
"title": "Funny videos",
"videos": [2, 3, 4]
}
]
}