function inherit(proto) {
  function F() {}
  F.prototype = proto;
  return new F;
}

var animal = {
  eats: true
}

var dog = inherit(animal);

console.log(dog.eats) // true
console.log(dog.hasOwnProperty('eats')); // false, from prototype

function Labrador(name) {
  this.name = name
}

Labrador.prototype = {
  bark: true
}

var ball = new Labrador('Ball');

for (var p in ball) {
  if (!ball.hasOwnProperty(p)) continue // filter out "barks"
  console.log(p + " = " + ball[p]); // outputs only "name"
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.