StefiIOE

[NWD] prv kolokvium 2018 zadaca 3

Nov 24th, 2020 (edited)
35
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Title</title>
  6. </head>
  7. <style>
  8. </style>
  9. <body>
  10. <script>
  11. var newReleases = [{
  12.         "id": 70111470,
  13.         "title": "Die Hard",
  14.         "boxart": "http://cdn-0.nflximg.com/images/2891/DieHard.jpg",
  15.         "uri": "http://api.netflix.com/catalog/titles/movies/70111470",
  16.         "rating": 4.0,
  17.         "bookmark": []
  18.     },
  19.     {
  20.         "id": 654356453,
  21.         "title": "Bad Boys",
  22.         "boxart": "http://cdn-0.nflximg.com/images/2891/BadBoys.jpg",
  23.         "uri": "http://api.netflix.com/catalog/titles/movies/70111470",
  24.         "rating": 5.0,
  25.         "bookmark": [{ id: 432534, time: 65876586 }]
  26.  
  27.     },
  28.     {
  29.         "id": 65432445,
  30.         "title": "The Chamber",
  31.         "boxart": "http://cdn-0.nflximg.com/images/2891/TheChamber.jpg",
  32.         "uri": "http://api.netflix.com/catalog/titles/movies/70111470",
  33.         "rating": 4.0,
  34.         "bookmark": []
  35.     },
  36.     {
  37.         "id": 675465,
  38.         "title": "Fracture",
  39.         "boxart": "http://cdn-0.nflximg.com/images/2891/Fracture.jpg",
  40.         "uri": "http://api.netflix.com/catalog/titles/movies/70111470",
  41.         "rating": 5.0,
  42.         "bookmark": [{ id: 432534, time: 65876586 }]
  43.     }
  44. ];
  45.  
  46. // DO Not change before this
  47.  
  48.  
  49. var popular = newReleases.filter(function(movies){
  50.     return movies.rating === 5.0;
  51. }).map(function(movies){
  52.     return movies.id;
  53. });
  54. console.log(popular); // Retuns [ 654356453, 675465 ]
  55.  
  56.  
  57. </script>
  58.  
  59. </body>
  60. </html>
RAW Paste Data