Created
June 13, 2013 18:31
-
-
Save hackingbeauty/5776158 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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