📅  最后修改于: 2022-03-11 15:02:43.403000             🧑  作者: Mango
let cargoHold = ['oxygen tanks', 'space suits', 'parrot',
'instruction manual', 'meal packs', 'slinky',
'security blanket'];
/*a) Use bracket notation to replace ‘slinky’ with ‘space tether’.
Print the array to confirm the change.*/
cargoHold[5] = "space tether";
console.log(cargoHold);
//OR// cargoHold.splice(5,1, 'space tether');
// console.log(cargoHold);