Tutorial by Examples

Constructor functions are functions designed to construct a new object. Within a constructor function, the keyword this refers to a newly created object which values can be assigned to. Constructor functions "return" this new object automatically. function Cat(name) { this.name = name;...

Page 1 of 1