1
2class Car {
3
4 constructor(name, year) {
5
6 this.name = name;
7
8 this.year = year;
9
10 }
11
12}
13
1
2let myCar1 = new Car("Ford", 2014);
3
4let myCar2 = new Car("Audi", 2019);
5
1var student = { // object name
2firstName:"Jane", // list of properties and values
3lastName:"Doe",
4age:18,
5height:170,
6fullName : function() { // object function
7 return this.firstName + " " + this.lastName;
8}
9};
10