Skip to content

Instantly share code, notes, and snippets.

@seanstrom
Last active August 29, 2015 14:12
Show Gist options
  • Save seanstrom/9848f6a9129f78596b34 to your computer and use it in GitHub Desktop.
Save seanstrom/9848f6a9129f78596b34 to your computer and use it in GitHub Desktop.
Exploring Constructors and Factories in Javascript - Wrapping Constructors With Object Example 2
var Person = require('./person')
var options = {name: 'Sean Hagstrom', age: 20}
var sean = Person.create(options)
console.log(sean.name) // Sean Hagstrom
console.log(sean.age) // 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment