Welcome aboard! We are happy you are here and wish you good net-raft!
<html>
<head>
</head>
<body>
<script type="text/javascript">
var array = [1, 2, 3, 4];
var index = 2;
var value = 5;
array.splice(index, 0, value); // 0 = don't remove the values
document.write(array);
</script>
</body>
</html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
function add(array, value) {
array.push(value);
value += 1;
}
var array = [1, 2, 3, 4];
var value = 5;
add(array, value);
alert(array);
</script>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 508