This file contains hidden or 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
npm_chpwd_hook() { | |
if [ -n "${PRENPMPATH+x}" ]; then | |
PATH=$PRENPMPATH | |
unset PRENPMPATH | |
fi | |
if [ -f package.json ]; then | |
PRENPMPATH=$PATH | |
PATH=$(npm bin):$PATH | |
fi | |
} |
This file contains hidden or 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 Person = require('./person') | |
console.log(name) // undefined | |
console.log(age) // undefined | |
var sean = Person('Sean Hagstrom', 20) | |
console.log(sean) // undefined | |
console.log(name) // Sean Hagstrom |
This file contains hidden or 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 Person = require('./person') | |
var sean = new Person('Sean Hagstrom', 20) | |
console.log(sean.name) // Sean Hagstrom | |
console.log(sean.age) // 20 |
This file contains hidden or 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 Person = require('./person') | |
console.log(name) // undefined | |
console.log(age) // undefined | |
var sean = Person('Sean Hagstrom', 20) | |
console.log(sean.name) // Sean Hagstrom | |
console.log(sean.age) // 20 |
This file contains hidden or 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 createPerson = require('./person') | |
var sean = createPerson('Sean Hagstrom', 20) | |
console.log(sean.name) // Sean Hagstrom | |
console.log(sean.age) // 20 |
This file contains hidden or 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 createPerson = require('./person') | |
var sean = createPerson('Sean Hagstrom', 20) | |
console.log(sean.name) // Sean Hagstrom | |
console.log(sean.age) // 20 |
This file contains hidden or 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 Person = require('./person') | |
var sean = Person.create('Sean Hagstrom', 20) | |
console.log(sean.name) // Sean Hagstrom | |
console.log(sean.age) // 20 |
This file contains hidden or 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 Person = require('./person') | |
var sean = Object.create(Person.prototype, { | |
name: { | |
configurable: true, // defaults to false | |
enumerable: true, // defaults to false | |
writable: true, // defaults to false | |
value: 'Sean Hagstrom' // defaults to undefined | |
}, | |
age: { |
This file contains hidden or 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 Person = require('./person') | |
var options = {name: 'Sean Hagstrom', age: 20} | |
var sean = new Person(options) | |
console.log(sean.name) // Sean Hagstrom | |
console.log(sean.age) // 20 |
This file contains hidden or 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 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 |
OlderNewer