1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.unshift('safari');
3console.log(browsers); // ["safari", "chrome", "firefox", "edge"]
1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.pop(); // "edge"
3console.log(browsers); // ["chrome", "firefox"]
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"]
1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.shift(); // "chrome"
3console.log(browsers); // ["firefox", "edge"]
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"]
1let browsers = ['chrome', 'firefox', 'edge'];
2browsers.push('safari', 'opera mini');
3console.log(browsers);
4// ["chrome", "firefox", "edge", "safari", "opera mini"]
1let firstNumbers = [1, 2, 3];
2let secondNumbers = [4, 5, 6];
3let merged = firstNumbers.concat(secondNumbers);
4console.log(merged); // [1, 2, 3, 4, 5, 6]