javascript atualize array

JavaScript
let yourArray = [1,2,3,4,5];
// if you want to change " 3 " for " 6 " you must count the indexs
// item | 1 2 3 4 5
// index| 0 1 2 3 4
yourArray[2] = 6
// yourArray -> [1,2,6,4,5]

Source

Also in JavaScript: