Skip to content

Instantly share code, notes, and snippets.

@hackingbeauty
Created June 13, 2013 18:31
Show Gist options
  • Save hackingbeauty/5776158 to your computer and use it in GitHub Desktop.
Save hackingbeauty/5776158 to your computer and use it in GitHub Desktop.
var proto = {
sentence : 4,
probation : 2
}
var makePrisoner = function(name,id) {
var prisoner = Object.create(proto);
prisoner.name = name;
prisoner.id = id;
return prisoner;
}
var firstPrisoner = makePrisoner('Joe','12A');
var secondPrisoner = makePrisoner('Sam','2BC');
console.log('firstPrisoner: ',firstPrisoner);
console.log('secondPrisoner: ',secondPrisoner);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment