Operations to change a variable in JavaScript

You can perform some operations on the current value of the variable, and then write the result back to the same variable. See an example:

javascriptlet num = 1;   // declare the variable num and write the value 1 to it
num = num + 2; // write to num itself plus 2
alert(num);    // shows 3
Задание 1

Without running the code, determine what will be displayed on the screen:

javascriptlet num = 1;
num = num + 1;
num = num + 1;

alert(num);
Задание 2

Without running the code, determine what will be displayed on the screen:

javascriptlet num = 1;
num = num + 2;
num = num + 3;

alert(num);