showing results for - "how to modify an array"
Maude
02 Nov 2019
1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.unshift('safari');
3console.log(browsers); //  ["safari", "chrome", "firefox", "edge"]
Valentina
15 Aug 2019
1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.pop(); // "edge"
3console.log(browsers); // ["chrome", "firefox"]
Salomé
27 Mar 2018
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"]
Miranda
14 Jul 2016
1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.shift(); // "chrome"
3console.log(browsers); // ["firefox", "edge"]
Angela
02 Mar 2016
1let schedule = ['I', 'have', 'a', 'meeting', 'with'];
2// adds 3 new elements to the array
3schedule.splice(5, 0, 'some', 'clients', 'tommorrow');
4console.log(schedule); 
5// ["I", "have", "a", "meeting", "with", "some", "clients", "tommorrow"]
Ilian
07 Sep 2019
1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.push('safari', 'opera mini');
3console.log(browsers); 
4// ["chrome", "firefox", "edge", "safari", "opera mini"]
Emiliano
18 Jul 2016
1let firstNumbers = [1, 2, 3];
2let secondNumbers = [4, 5, 6];
3let merged = firstNumbers.concat(secondNumbers);
4console.log(merged); // [1, 2, 3, 4, 5, 6]
queries leading to this page
modify in array in javascripthow to update array in javascriptedit array using array methodschanging an array elementow to modify arrayjavascript update arrayjavascript modify element in arrayarray modify javascripthow to modify an array value in jshow to modify an arraychange array in a methodjavascript how to change arrayediting an array in exceljavascript array modify each elementhow to modify value of arrayhow to modify arrya in place javascriptmodifying arrays in javascriptmodify an array jsmodify array 28array 29 functionmodify item in array jsediting array with function javascriptmodify an element in an array javascripthow to edit an array jsupdating array javascripthow to edit array in javascriptjavascript modify array inside functionjs list modify in placehow to modify an array in javascriptediting an arrayhow to edit array jshow to change element arrayhow to change in an array using a functionmodify array in javascriptmodify array value javascriptmodify array jsjs modify array in functionchange value of arrayarray method to modify arrayhow to access and modify arrayhow to modify my array in jsmodify array array function javascriptmodify an array javascripthow to change the array into variable in node jsjsupdating new arraysarray of arrays modify elementmodify array javascriptmodify array function javascriptchange array wayhow to change array in functionhow to edit in arrayjavascript edit arrays changing elements of the array in jschange an array in functionmodify arrray jsmodify arraysmodify arraymodify elements of arraymodify array hsjavascript modify arraywhich array to modify items in arrayedit array element javascripthow to modify array in javascripthow to edit an array in jshow to chang arraysmodify elements in array javascriptmodify all elements in array javascripthow to edit array element in javascripthow to modify an array javascripthow to change array elemenetmodify array string outputjavascript array method to edit each item in arraymodify array elementchange part of an arrayhow to change array elementjavascript array change all valuesmodify elements in array which method to use jsmodify the array javascriptmodifing an arrayjavascript array modify elementmodify an array how to modify arraymodify array inside array javascripthow to edit array elementmodify items in array jsjavascript array modifyedit array javascriptjavascript modify array in placejavascript change parts of array modify array elements javascriptmodify array in place javascriptedit array node jschange an array elementhow to change array elementshow to edit arrayhow to edit an array in javascriptjavascript modify array item for eachhow to change arraymodify array element javascriptjs array modify element modify directly an array jsjavascript modify item in arrayjavascript modify an arrayhow to modify an array