Assign to an index to change or add elements:
let nums = [10, 20, 30]
nums[1] = 25 // Change existing
console.log(nums) // [10, 25, 30]
nums[3] = 40 // Add new element
console.log(nums) // [10, 25, 30, 40]
Unlike strings, arrays are mutable. You can change their contents without creating a new array.