class JsMadness { constructor(reason) { this.reason = reason } madness() { console.log(this.reason) } } let m = new JsMadness("because it's madness!") m.madness() // TypeError: Cannot read property 'reason' of undefined // at madness (/Users/ikalnytskyi/test.js:6:22) // at Object. (/Users/ikalnytskyi/test.js:14:1) // at Module._compile (module.js:635:30) // at Object.Module._extensions..js (module.js:646:10) // at Module.load (module.js:554:32) // at tryModuleLoad (module.js:497:12) // at Function.Module._load (module.js:489:3) // at Function.Module.runMain (module.js:676:10) // at startup (bootstrap_node.js:187:16) // at bootstrap_node.js:608:3 let p = m.madness p()