what are objects in java script code example
Example 1: how to create object in javascript with class
class Car {
constructor(name, year) {
this.name = name;
this.year = year;
}
}
Example 2: objects javascript
function Dog() {
this.name = "Bailey";
this.colour = "Golden";
this.breed = "Golden Retriever";
this.age = 8;
}