function insert(arr, item, index) { const cloneArr = [...arr] cloneArr[index] = [item, arr[index]] return cloneArr.flat() }