Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript Object Prototypes

function Person(first, last, age, eyecolor) {
  this.firstName = first;
  this.lastName = last;
  this.age = age;
  this.eyeColor = eyecolor;
}

const myFather = new Person("John", "Doe", 50, "blue");
const myMother = new Person("Sally", "Rally", 48, "green");
Source by codefantasy.org #
 
PREVIOUS NEXT
Tagged: #JavaScript #Object #Prototypes
ADD COMMENT
Topic
Name
8+2 =