Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #keyword #js
ADD COMMENT
Topic
Name
7+9 =