array[1, 2] references two array elements, starting with the element at index 1, and this statement replaces two elements in the array, not just one:
array = ["Hello", "there", "AAA", 1, 2, 3]
array[1, 2] = "here"
p array
Related examples in the same category