How to delete values from array after index ?
var array = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60];
I tried like using slice():
var new_array = fruits.slice(2);
// console.log(new_array ) prints
[15, 20, 25, 30, 35, 40, 45, 50, 55, 60]
But i want the output to delete all values in array after index
And expected output of the array is :
[5,10,15]