Adding elements to objects in JavaScript

You can add new elements to objects by writing them to the desired keys. Let's see how it's done. Let's have the following object:

javascriptlet obj = {};

Let's add new elements to it:

javascriptobj['a'] = 1;
obj['b'] = 2;
obj['c'] = 3;

You can use alternative syntax:

javascriptobj.a = 1;
obj.b = 2;
obj.c = 3;

Check the content of the object:

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

Create an empty object and then fill it with values.