Replaces the element at the given index with the specified value.
Note: Indexing takes place according to the initial data.