Rewriting array elements in JavaScript

You can also read the current value of an element, perform some operation on it, and write the changed value back to that element:

javascriptlet arr = ['a', 'b', 'c'];

arr[0] = arr[0] + '!';
arr[1] = arr[1] + '!';
arr[2] = arr[2] + '!';

console.log(arr); // shows ['a!', 'b!', 'c!']

The previous code can be rewritten using the operator +=:

javascriptlet arr = ['a', 'b', 'c'];

arr[0] += '!';
arr[1] += '!';
arr[2] += '!';

console.log(arr); // shows ['a!', 'b!', 'c!']
Задание 1

Create an array with numbers. Add the number 3 to each element of the array. Display the modified array on the screen.