Because JavaScript is a dynamic programming language, we can add properties and methods to an instance of an object at runtime, and they don't need to be part of the object (class) itself. Let's look at an example:
function Person(name, surname) { // instance properties this.name = name; this.surname = surname; } const person = new Person("Remo", "Jansen"); person.age = 27;
We have defined a constructor function for an object named person, which takes two variables (name and surname) as arguments. Then, we have created an instance of the Person object and added a new property named age to it. We can use a for...in statement to check the properties of person at runtime:
for(let property in person) ...