Javascript Array Question 13

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');  

// shift two entries
console.log(queue.shift());  // w ww. j a v a2s. c om
console.log(queue.shift());  
console.log(queue);  


first
second
third



PreviousNext

Related