Skip to content

Instantly share code, notes, and snippets.

@timoxley
Forked from bcleenders/gist:3070309
Created July 8, 2012 10:18
Show Gist options
  • Save timoxley/3070374 to your computer and use it in GitHub Desktop.
Save timoxley/3070374 to your computer and use it in GitHub Desktop.
function createResponse(name) {
this.name = name,
this.sayHi = function() {
return 'Hi!';
},
this.getName = function() {
return this.name;
},
this.inspect = function() {
return 'This should be outputted';
};
}
var test = new createResponse('John Doe');
// Should output a custom text, such as 'user: John Doe', instead of giving all visible variables
console.log(test);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment