Javascript Array Question 14

Introduction

What is the output of the following code?


// create new array
let queue = new Array();

// push on three entries
queue.push('first');  
queue.push('second'); 
queue.push('third'); 

// pop two entries
console.log(queue.pop());  //from w w  w  .j  ava2s.com
console.log(queue.pop()); 
console.log(queue);


third
second
first



PreviousNext

Related