1Using a FOR loop, write a function addNumber which adds the argument n to each
2number in the array arr and returns the updated arr:
3const addNumber=(arr, n)=>{
4 let arr1=[];
5 for(let i=0;i<Math.max(arr.length);i++){
6 arr1.push((arr[i]||0)+n)
7 }
8 return arr1;
9}
10console.log(addNumber([4, 5, 6], 7)); // expected log [11, 12, 13]
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.shift(); // "chrome"
3console.log(browsers); // ["firefox", "edge"]