I created an array named 'arr' with four elements.
var arr = ["apple", "ball", "cat", "elephant"];
How can I push an element in the exact location (here, [3])? The results should be:
var arr = ["apple", "ball", "cat", "dog", "elephant"];
I created an array named 'arr' with four elements.
var arr = ["apple", "ball", "cat", "elephant"];
How can I push an element in the exact location (here, [3])? The results should be:
var arr = ["apple", "ball", "cat", "dog", "elephant"];