Here is a code that inserts an item to specific index. Here, there is no pushing or popping, instead just replace at an index.
const arr = [2, 5, 7, 9]; arr = 8; // 👉 O(1) console.log(arr); // 8
The position can be easily calculated by the index number and each item size.
Irrespective of the index position, time taken to insert a value is a constant.
Big-O of inserting an item to array is O(1)