Last active
October 13, 2015 16:33
-
-
Save elicwhite/8ec9702df52ff302715d to your computer and use it in GitHub Desktop.
Expose helpers on functions
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
'use strict'; | |
var privateState = require('privatestate'); | |
function nameHelper(first, last) { | |
return first + ' ' + last; | |
} | |
function Person(first, last) { | |
this.first = first; | |
this.last = last; | |
} | |
Person.prototype = { | |
welcome: function() { | |
return 'My name is ' + nameHelper(this.first, this.last); | |
} | |
} | |
privateState.registerTestingFunctions(Person, ['nameHelper']); | |
module.exports = Person; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment