
JavaScript 队列
function queue(arr, item) {
// Your code here
item =arr.push(item);
item=arr.shift();
return item;// Change this line
}
// Test Setup
var testArr = [1,2,3,4,5];
// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));