Skip to content

Instantly share code, notes, and snippets.

@thmain
Created December 25, 2022 05:30
Show Gist options
  • Save thmain/5b8ca66e9d77677401b9243fc4f586de to your computer and use it in GitHub Desktop.
Save thmain/5b8ca66e9d77677401b9243fc4f586de to your computer and use it in GitHub Desktop.
'use strict';
function chain() {
var newReleases = [{
"id": 70111470,
"title": "Die Hard",
"rating": 4.0
}, {
"id": 654356453,
"title": "Bad Boys",
"rating": 5.0
}, {
"id": 65432445,
"title": "The Chamber",
"rating": 4.0
}, {
"id": 675465,
"title": "Fracture",
"rating": 5.0
}];
var result = [];
return newReleases.
filter(video => video.rating === 5.0).
map(video => video.id);
}
console.log(chain());
/*
[654356453, 675465]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment