var everything ={ answer:24, write:function(){ console.log(this); console.log(this.answer); } } var nothing={ answer:42, write:function(){ console.log(this); console.log(44) } } var something=everything.write.bind(nothing); something();
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter