I am a JS beginner and am doing basic tutorials. I am trying to perform a zip function to return a list of {videoID: bookmarkID}. So take for example:
var videos = [
{
"id": 70111470,
"title": "Die Hard"
},
{
"id": 654356453,
"title": "Bad Boys"
},
{
"id": 65432445,
"title": "The Chamber"
}
],
bookmarks = [
{id: 470, time: 23432},
{id: 453, time: 234324},
{id: 445, time: 987834}
];
}
This does not work (I get unexpected token '.'):
return Array.zip(videos,bookmarks, function(v, b){
return {v.id: b.id};
});
This does, but returns a list containing {'v': bookmarkID}:
return Array.zip(videos,bookmarks, function(v, b){
return {v: b.id};
});
How do I get the video ID to be the key for the value bookmarkID? Also, are these technically maps or objects? Thanks.