new.js code example
Example 1: keyword new js
function Car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}
//create a object with three keys, make, model, and year
var myCar = new Car('Eagle', 'Talon TSi', 1993);
// use the new operator to create any number of car objects with this template object Car above
Example 2: new js
The new operator lets developers create an instance of a user-defined object type or of one of the built-in object types that has a constructor function.