Iterating over an object with a for-in loop in JavaScript

The loop for-in is intended to iterate over objects. It has the following syntax:

javascriptfor (let variableForKey in object) {
  
}

In variableForKey the keys of the iterated object will fall sequentially. Let's try with some example. Suppose we have such an object:

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

Let's use the loop for-in to derive the keys of this object:

javascriptfor (let key in obj) {
  console.log(key); // shows 'a', 'b', 'c'
}

Now let's get the elements:

javascriptfor (let key in obj) {
  console.log(obj[key]); // shows 1, 2, 3
}
Задание 1

Print all the keys of the following object to the console:

javascriptlet obj = {x: 1, y: 2, z: 3};
Задание 2

Print all the elements of the following object to the console:

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