Skip to content

Instantly share code, notes, and snippets.

View roccomuso's full-sized avatar

Rocco Musolino roccomuso

View GitHub Profile
@roccomuso
roccomuso / oop in javascript.js
Last active April 5, 2017 17:38
Prototypal Pattern vs Classical OOP in JS.js
var human = {
species: "human",
create: function(values) {
var instance = Object.create(this);
Object.keys(values).forEach(function(key) {
instance[key] = values[key];
});
return instance;
},
saySpecies: function() {