insert into specific array index that has a value existing on that index

JavaScript
var colors=["red","blue"];
var index=1;

//insert "white" at index 1
colors.splice(index, 0, "white");   //colors =  ["red", "white", "blue"]

Source

Also in JavaScript: