Last active
August 29, 2015 14:01
-
-
Save incompl/4fbe91f43b1d3c08cc63 to your computer and use it in GitHub Desktop.
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 Egg = require('egg.js'); | |
Egg.publicMethod(); | |
var Person = require('ConstructorExample.js'); | |
var greg = new Person('Greg'); |
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
function Person(name) { | |
this.name = name; | |
} | |
Person.prototype = { | |
getNameQuestion: function() { | |
return this.name;+ '?'; | |
} | |
}; | |
module.exports = Person; |
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 privateValue; | |
function privateMethod() { | |
} | |
module.exports = { | |
publicMethod: function() { | |
return privateMethod(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment