var a ={
  "page": 1,
  "results": [
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [],
      "id": 555879,
      "original_language": "en",
      "original_title": "Matrix",
      "overview": "The film is composed of receding planes in a landscape: a back garden and the houses beyond. The wooden lattice fence, visible in the image, marks the border between enclosed and open, private and public space, and forms both a fulcrum for the work and a formal grid by which the shots are framed and organised.",
      "popularity": 3.265,
      "poster_path": "/AfFD10ZqEx2vkxM2yvRZkybsGB7.jpg",
      "release_date": "1998-12-31",
      "title": "Matrix",
      "video": false,
      "vote_average": 7.265,
      "vote_count": 17
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [],
      "id": 775293,
      "original_language": "en",
      "original_title": "Matrix",
      "overview": "\"MATRIX is a flicker film which utilizes 81 still photographs of my wife's head. It is a film dependent upon variation of intense light changes by calculated combinations of black and white frame alternations with exposure changes. Throughout, the light intensity rises and falls as the head rotates in varying directions within a 360 degree frontal area.\" — James Cagle",
      "popularity": 1.052,
      "poster_path": "/frDqG8rmqKUg4HzQ604LZo8VLHB.jpg",
      "release_date": "1973-01-01",
      "title": "Matrix",
      "video": false,
      "vote_average": 6.7,
      "vote_count": 5
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [],
      "id": 373223,
      "original_language": "en",
      "original_title": "Matrix",
      "overview": "Abstract art film made for gallery exhibition.",
      "popularity": 0.799,
      "poster_path": "/wx2s9xYeC6uP2auuuVg99yl4RpU.jpg",
      "release_date": "1973-09-06",
      "title": "Matrix",
      "video": false,
      "vote_average": 6.321,
      "vote_count": 14
    },
    {
      "adult": false,
      "backdrop_path": "/oMsxZEvz9a708d49b6UdZK1KAo5.jpg",
      "genre_ids": [
        28,
        878
      ],
      "id": 603,
      "original_language": "en",
      "original_title": "The Matrix",
      "overview": "Хакер Томас Андерсон одного дня опиняється перед вибором, запропонованим таємничими незнайомцями. Він може продовжувати жити у своєму звичайному світі, який насправді — лише сон. Або ж поглянути в обличчя страшній реальності?",
      "popularity": 70.531,
      "poster_path": "/58748AndVH1DitlTbcbLpKHuSS2.jpg",
      "release_date": "1999-03-30",
      "title": "Матриця",
      "video": false,
      "vote_average": 8.205,
      "vote_count": 23747
    },
    {
      "adult": false,
      "backdrop_path": "/eNI7PtK6DEYgZmHWP9gQNuff8pv.jpg",
      "genre_ids": [
        878,
        28,
        12
      ],
      "id": 624860,
      "original_language": "en",
      "original_title": "The Matrix Resurrections",
      "overview": "У стрічці ми повертаємось до світу з двома реальностями. Одна — це щоденне життя, інша ж існує за межами буденності. Реальність є фізичним чи ментальним конструктом? Щоб з’ясувати це та по-справжньому пізнати себе, містер Андерсон має знову вирішити, чи йти за білим кроликом. І якщо Томас… Нео… засвоїв урок, то хіба що про те, що вибір, хоч це й ілюзія, — все ще єдиний шлях до виходу з Матриці або входу до неї. Звісно, Нео вже розуміє, що має зробити. Але він ще не знає, що Матриця — сильніша, більш захищена та небезпечна, ніж будь-коли раніше. Дежавю.",
      "popularity": 62.752,
      "poster_path": "/mD2aIpi8AS2DtLseABLPF9nk6gs.jpg",
      "release_date": "2021-12-16",
      "title": "Матриця: Воскресіння",
      "video": false,
      "vote_average": 6.487,
      "vote_count": 4982
    },
    {
      "adult": false,
      "backdrop_path": "/pxK1iK6anS6erGg4QePmMKbB1E7.jpg",
      "genre_ids": [
        12,
        28,
        53,
        878
      ],
      "id": 604,
      "original_language": "en",
      "original_title": "The Matrix Reloaded",
      "overview": "Нео, Морфей та Трініті намагаються захистити підземне місто Зіон - останню схованку людей,  про існування якої нарешті дізнались безжалісні машини. Для цього героям потрібно проникнути у світ Матриці і перезавантажити її.",
      "popularity": 38.014,
      "poster_path": "/2vLxAuigPALOav9djySvspJxr2A.jpg",
      "release_date": "2003-05-15",
      "title": "Матриця: Перезавантаження",
      "video": false,
      "vote_average": 7.039,
      "vote_count": 10091
    },
    {
      "adult": false,
      "backdrop_path": "/533xAMhhVyjTy8hwMUFEt5TuDfR.jpg",
      "genre_ids": [
        12,
        28,
        53,
        878
      ],
      "id": 605,
      "original_language": "en",
      "original_title": "The Matrix Revolutions",
      "overview": "Поки залишки армії Зіона б’ються з безжалісними машинами, агент Сміт виходить з-під контролю своїх колишніх господарів і завойовує світ Матриці. Нео вирушає до міста машин, зустрічається з «комп’ютерним богом» і укладає з ним угоду. Долі людей та їх механічних противників залежать від результату двобою Нео зі Смітом...",
      "popularity": 30.307,
      "poster_path": "/36c4VMu2Bv788yHI3lVJALedHjX.jpg",
      "release_date": "2003-11-05",
      "title": "Матриця: Революція",
      "video": false,
      "vote_average": 6.71,
      "vote_count": 9083
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        16,
        878,
        53
      ],
      "id": 33322,
      "original_language": "ja",
      "original_title": "アミテージ・ザ・サード POLY-MATRIX",
      "overview": "Ross Sylibus is assigned to a police unit on a Martian colony, to find that women are being murdered by a psychotic named D'anclaude. He is assigned a very unorthodox partner named Naomi Armitage, who seems to have links to the victims. To stir things up more, every victim is found to be an illegally made third-generation android.",
      "popularity": 5.06,
      "poster_path": "/7sUCRdjGe7VggDCGIHywfguYdAK.jpg",
      "release_date": "1996-06-25",
      "title": "Armitage III: Poly Matrix",
      "video": false,
      "vote_average": 6.446,
      "vote_count": 46
    },
    {
      "adult": false,
      "backdrop_path": "/t6qYLZStr1wBxsUb9O9dTpbtOm6.jpg",
      "genre_ids": [
        53,
        28,
        16,
        878,
        12
      ],
      "id": 21769,
      "original_language": "ja",
      "original_title": "アミテージ・ザ・サード DUAL-MATRIX",
      "overview": "Naomi Armitage and Ross Sylibus have changed their names and live with their daughter Yoko as a happy and normal family on Mars — until an android riot breaks out at an anti-matter plant on Earth.",
      "popularity": 4.939,
      "poster_path": "/p5nd9VPKxpow5MFAQfZy2DEatPI.jpg",
      "release_date": "2002-03-22",
      "title": "Armitage: Dual Matrix",
      "video": false,
      "vote_average": 6.5,
      "vote_count": 38
    },
    {
      "adult": false,
      "backdrop_path": "/lBdXACywnLwKUZmZkZ87djDQBeV.jpg",
      "genre_ids": [
        99
      ],
      "id": 14543,
      "original_language": "en",
      "original_title": "The Matrix Revisited",
      "overview": "The film goes behind the scenes of the 1999 sci-fi movie The Matrix.",
      "popularity": 10.354,
      "poster_path": "/8yxSztoc5sqZiGuKcFuVOh65B6Y.jpg",
      "release_date": "2001-11-19",
      "title": "The Matrix Revisited",
      "video": false,
      "vote_average": 6.816,
      "vote_count": 177
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        878
      ],
      "id": 51767,
      "original_language": "en",
      "original_title": "Sexual Matrix",
      "overview": "A professor designing a machine designed to meet the naughtiest fantasies. In order to perfect the discovery, he performed tests on various subjects, aided by his very appealing assistant.",
      "popularity": 3.776,
      "poster_path": "/vmhBIPKyYCWlp2PrIIc6EXZlP9Z.jpg",
      "release_date": "2000-04-01",
      "title": "Sexual Matrix",
      "video": false,
      "vote_average": 7,
      "vote_count": 16
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        99
      ],
      "id": 503880,
      "original_language": "en",
      "original_title": "The Matrix Revolutions Revisited",
      "overview": "The making of The Matrix Revolutions:  The cataclysmic final confrontation chronicled through six documentary pods revealing 28 featurettes",
      "popularity": 5.611,
      "poster_path": "/61ASnmqvzpuz9VEfFElo3e2nIft.jpg",
      "release_date": "2004-12-07",
      "title": "The Matrix Revolutions Revisited",
      "video": true,
      "vote_average": 7.176,
      "vote_count": 17
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        99,
        878
      ],
      "id": 221495,
      "original_language": "en",
      "original_title": "The Matrix Recalibrated",
      "overview": "The making of Matrix Revolutions, The (2003) is briefly touched on here in this documentary. Interviews with various cast and crew members inform us how they were affected by the deaths of Gloria Foster and Aaliyah, and also delve into the making of the visual effects that takes up a lot of screen time. Written by Rhyl Donnelly",
      "popularity": 5.887,
      "poster_path": "/gRni1Q651AZPnLqZczmahiIxG0s.jpg",
      "release_date": "2004-04-06",
      "title": "The Matrix Recalibrated",
      "video": true,
      "vote_average": 6.6,
      "vote_count": 41
    },
    {
      "adult": false,
      "backdrop_path": "/5nxDn3mrdmeUHJOZi1Wfqya8Vji.jpg",
      "genre_ids": [
        99
      ],
      "id": 696109,
      "original_language": "en",
      "original_title": "A Glitch in the Matrix",
      "overview": "Are we in fact living in a simulation? This is the question postulated, wrestled with, and ultimately argued for through archival footage, compelling interviews with real people shrouded in digital avatars, and a collection of cases from some of our most iconoclastic figures in contemporary culture.",
      "popularity": 7.007,
      "poster_path": "/bn0BLVadmvzq6MmJ0n97MLxGpNQ.jpg",
      "release_date": "2021-02-05",
      "title": "A Glitch in the Matrix",
      "video": false,
      "vote_average": 5.081,
      "vote_count": 31
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        99
      ],
      "id": 684740,
      "original_language": "en",
      "original_title": "The Matrix Revolutions: Neo Realism - Evolution of Bullet Time",
      "overview": "A featurette about the special effects of The Matrix Trilogy",
      "popularity": 3.143,
      "poster_path": "/2US7uuM36El9pnk8WLdGh1XN39r.jpg",
      "release_date": "2004-04-06",
      "title": "The Matrix Revolutions: Neo Realism - Evolution of Bullet Time",
      "video": false,
      "vote_average": 7.2,
      "vote_count": 10
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        99
      ],
      "id": 591955,
      "original_language": "en",
      "original_title": "The Matrix Reloaded Revisited",
      "overview": "The making of The Matrix Reloaded:  Go to the middle movie's furthest reaches via five documentary paths revealing 21 featurettes.",
      "popularity": 4.78,
      "poster_path": "/gb7C4oRzYWXWCuZMR1cwtHa53Pz.jpg",
      "release_date": "2004-12-07",
      "title": "The Matrix Reloaded Revisited",
      "video": true,
      "vote_average": 6.786,
      "vote_count": 21
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        99
      ],
      "id": 684431,
      "original_language": "en",
      "original_title": "Making 'The Matrix'",
      "overview": "A promotional making-of documentary for the film Matrix, The (1999) that devotes its time to explaining the digital and practical effects contained in the film. This is very interesting, seeing as how they're giving away the cinematic secrets that they created solely for the this movie, that have now been spoofed and referenced in countless other films.",
      "popularity": 2.675,
      "poster_path": "/m2yIfRJYwpCgHON1Ig1pNKMWTxp.jpg",
      "release_date": "1999-09-21",
      "title": "Making 'The Matrix'",
      "video": false,
      "vote_average": 7.933,
      "vote_count": 15
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        99
      ],
      "id": 684731,
      "original_language": "en",
      "original_title": "The Matrix Reloaded: Pre-Load",
      "overview": "This making-of piece offers the standard mix of movie snippets, behind the scenes materials, and interviews from cast and crew on the making of the film.",
      "popularity": 3.143,
      "poster_path": null,
      "release_date": "2003-10-14",
      "title": "The Matrix Reloaded: Pre-Load",
      "video": false,
      "vote_average": 6,
      "vote_count": 18
    },
    {
      "adult": false,
      "backdrop_path": null,
      "genre_ids": [
        99,
        28,
        878
      ],
      "id": 684428,
      "original_language": "en",
      "original_title": "The Matrix: What Is Bullet-Time?",
      "overview": "Special Effects wizard John Gaeta demonstrates how the \"Bullet-Time\" effects were created for the film Matrix, The (1999).",
      "popularity": 2.57,
      "poster_path": "/hSTervHaROcTd8Ir3DPfepN80dL.jpg",
      "release_date": "1999-09-21",
      "title": "The Matrix: What Is Bullet-Time?",
      "video": false,
      "vote_average": 5.8,
      "vote_count": 9
    },
    {
      "adult": false,
      "backdrop_path": "/1wdULm68hAqRwaQH9GuVcGO430e.jpg",
      "genre_ids": [
        99
      ],
      "id": 850111,
      "original_language": "en",
      "original_title": "Delusions End: Breaking Free of the Matrix",
      "overview": "In a world of lies and deception and false hopes, the time is now to remove the blinders of deception and take back our lives.",
      "popularity": 2.002,
      "poster_path": "/5sfH0dXcRrzMmuQ7tBdQl0n9PXv.jpg",
      "release_date": "2021-07-13",
      "title": "Delusions End: Breaking Free of the Matrix",
      "video": false,
      "vote_average": 0,
      "vote_count": 0
    }
  ],
  "total_pages": 4,
  "total_results": 80
}


console.log(a) 

Javascript Online Compiler

Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich online compilers for Javascript language. Getting started with the OneCompiler's Javascript editor is easy and fast. The editor shows sample boilerplate code when you choose language as Javascript and start coding.

About Javascript

Javascript(JS) is a object-oriented programming language which adhere to ECMA Script Standards. Javascript is required to design the behaviour of the web pages.

Key Features

  • Open-source
  • Just-in-time compiled language
  • Embedded along with HTML and makes web pages alive
  • Originally named as LiveScript.
  • Executable in both browser and server which has Javascript engines like V8(chrome), SpiderMonkey(Firefox) etc.

Syntax help

STDIN Example

var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', function(line){
    console.log("Hello, " + line);
});

variable declaration

KeywordDescriptionScope
varVar is used to declare variables(old way of declaring variables)Function or global scope
letlet is also used to declare variables(new way)Global or block Scope
constconst is used to declare const values. Once the value is assigned, it can not be modifiedGlobal or block Scope

Backtick Strings

Interpolation

let greetings = `Hello ${name}`

Multi line Strings

const msg = `
hello
world!
`

Arrays

An array is a collection of items or values.

Syntax:

let arrayName = [value1, value2,..etc];
// or
let arrayName = new Array("value1","value2",..etc);

Example:

let mobiles = ["iPhone", "Samsung", "Pixel"];

// accessing an array
console.log(mobiles[0]);

// changing an array element
mobiles[3] = "Nokia";

Arrow functions

Arrow Functions helps developers to write code in concise way, it’s introduced in ES6.
Arrow functions can be written in multiple ways. Below are couple of ways to use arrow function but it can be written in many other ways as well.

Syntax:

() => expression

Example:

const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const squaresOfEvenNumbers = numbers.filter(ele => ele % 2 == 0)
                                    .map(ele => ele ** 2);
console.log(squaresOfEvenNumbers);

De-structuring

Arrays

let [firstName, lastName] = ['Foo', 'Bar']

Objects

let {firstName, lastName} = {
  firstName: 'Foo',
  lastName: 'Bar'
}

rest(...) operator

 const {
    title,
    firstName,
    lastName,
    ...rest
  } = record;

Spread(...) operator

//Object spread
const post = {
  ...options,
  type: "new"
}
//array spread
const users = [
  ...adminUsers,
  ...normalUsers
]

Functions

function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo
  console.log(`Hello ${name}!`);
}
 
greet() // Hello Foo
greet({ name: 'Bar' }) // Hi Bar

Loops

1. If:

IF is used to execute a block of code based on a condition.

Syntax

if(condition){
    // code
}

2. If-Else:

Else part is used to execute the block of code when the condition fails.

Syntax

if(condition){
    // code
} else {
    // code
}

3. Switch:

Switch is used to replace nested If-Else statements.

Syntax

switch(condition){
    case 'value1' :
        //code
        [break;]
    case 'value2' :
        //code
        [break;]
    .......
    default :
        //code
        [break;]
}

4. For

For loop is used to iterate a set of statements based on a condition.

for(Initialization; Condition; Increment/decrement){  
//code  
} 

5. While

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while (condition) {  
  // code 
}  

6. Do-While

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.

do {  
  // code 
} while (condition); 

Classes

ES6 introduced classes along with OOPS concepts in JS. Class is similar to a function which you can think like kind of template which will get called when ever you initialize class.

Syntax:

class className {
  constructor() { ... } //Mandatory Class method
  method1() { ... }
  method2() { ... }
  ...
}

Example:

class Mobile {
  constructor(model) {
    this.name = model;
  }
}

mbl = new Mobile("iPhone");