Author: Not specified Language: text
Description: Not specified Timestamp: 2018-05-10 10:47:08 +0000
View raw paste Reply
  1. var myObject = {
  2.     foo: "bar",
  3.     func: function() {
  4.         var self = this;
  5.         console.log("outer func:  this.foo = " + this.foo);
  6.         console.log("outer func:  self.foo = " + self.foo);
  7.         (function() {
  8.             console.log("inner func:  this.foo = " + this.foo);
  9.             console.log("inner func:  self.foo = " + self.foo);
  10.         }());
  11.     }
  12. };
  13. myObject.func();
View raw paste Reply