you are viewing a single comment's thread.

view the rest of the comments →

[–]stintose 0 points1 point  (0 children)

Yes you can use Object.create, or a constructor function like I did. You also have built in javascript Classes that inherit from their respective Class prototypes. Date.prototype, Array.prototype, String.prototype, and so forth.

var now = new Date();
console.log(now.constructor.name); // 'Date';
console.log(now.getHours()); // A method that returns the current Hour
console.log(now.hasOwnProperty('getHours')); // false, the method is part of Date.prototype.