showing results for - "code to insert modified elements back to array in javascript"
Henrietta
27 Apr 2020
1let schedule = ['I', 'have', 'a', 'meeting', 'tommorrow'];
2// removes 4 first elements and replace them with another
3schedule.splice(0, 4, 'we', 'are', 'going', 'to', 'swim');
4console.log(schedule); 
5// ["we", "are", "going", "to", "swim", "tommorrow"]