To important properties of objects, or they are dynamic, and we can have any type of value. So for example, if we have an object called person again, person, and then equals two curly braces, and it has two properties, name, john and age, age 23. And we want to add another property. It's so simple. You don't have to come here inside and add the property. You just can use the object itself, and then use the dot notation and then add the property that you want.
Suppose that you want to add the height for that person, you would just type dot and then height Then equals to the value that you want to assign for this property. So I want this value to be 180. And if I now use the console, console dot log, and then I print out this object, I am going to get this object with three properties, because this property was dynamically added after the creation of the object. And of course, you can add as many properties as you want later. If you want to add more, because sometimes you just want to add more properties because your program requires you to add more properties as your program grows bigger and bigger. Another important property is that objects can have different types of values.
So far, we only use strings as well as integers with our But you can add also functions inside objects, let me show you, you just see your ad comma. And instead of using just the string or integer, you just type the name of the function, for example, get Country, Country. And then you just add a colon. And instead of just adding a string, or an integer, you type up your function and then just add your parentheses, and then curly braces and inside those curly braces, you add the code for this function for this function that you want this this function to do. So I want this function to just print out the country or the nationality of that person. For example, us, right?
And if now I see and now if I call this function, instead of printing out the complete object here I am going to use the object itself and then I am going to call the get country function, parentheses and then semicolon. If now I save and run, I am going to get us. So this is the power of using objects. objects have many, many properties. And objects can also have different types of values and the different types of data type and they are dynamic.