參考自: https://love2dev.com/blog/javascript-remove-from-array/ 1. Removing Elements from End of Array var ar = [1, 2, 3, 4, 5, 6]; ar.length = 4; // set length to remove elements console.log( ar ); // [1, 2, 3, 4] var ar = [1, 2, 3, 4, 5, 6]; ar.pop();…