Changing objects with a loop in JavaScript

Objects can also be changed in a loop. Let, for example, we have such an object:

javascriptlet obj = {a: 1, b: 2, c: 3};

Let's loop through it with for-in and increase each of its elements by 2 times:

javascriptfor (let key in obj) {
  obj[key] = obj[key] * 2;
}

Let's check the result:

javascriptconsole.log(obj);
Задание 1

Given an object:

javascriptlet obj = {x: 1, y: 2, z: 3};

Loop through this object and square each element of this object.

Задание 2

Given an object:

javascriptlet obj = {x: 1, y: 2, z: 3};

Iterate over this object and increment each element of this object by one.