SHARE
TWEET

Untitled

a guest Feb 27th, 2012 17 Never
  1. function MyObject(name) {
  2.   this.name = name
  3. }
  4.  
  5. MyObject.prototype.toString = function() { return "My name is " + this.name }
  6.  
  7. > a = new MyObject("node")
  8. > a.toString()
  9. My name is node
RAW Paste Data
Top