Skip to content

Instantly share code, notes, and snippets.

@bcleenders
Created July 8, 2012 10:02
Show Gist options
  • Save bcleenders/3070309 to your computer and use it in GitHub Desktop.
Save bcleenders/3070309 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.toString = 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