Object Properties in OOP in JavaScript
Let's now learn how to work with object properties. Properties allow you to write some data to an object and then read it back. Let's look at an example. Let's say we have an object of the User class from the previous lesson:
let user = new User;
Let's write some data to the properties of our object:
user.name = 'john';
user.surn = 'smit';
Now let's read these properties:
console.log(user.name);
console.log(user.surn);
In the object of class Employee, write the properties name, age and salary.
Get data from the recorded properties and display it on the screen.