Loading ...
Sorry, an error occurred while loading the content.

2686this question

Expand Messages
  • Nagy Endre
    Nov 18, 2011
      Hi everyone, maybe it's a little offtopic sorry, but can anyone explain why "this" inside the "o" object is refer to window ?
      Why it's not refer to the "o" object if we are inside there? I want to access from the returned object in function "f" the "o.p" property without using "o". Thanks!

      var p = 2,
          o  =  {
              p: "a",
              f: (function (m) {
                  return {
                      l: m.p
                  };
              }(this))
          };

      p = o.f.l;

      Endre


      [Non-text portions of this message have been removed]
    • Show all 22 messages in this topic