Different this binding in JS

Viewed 28

Suppose I have this object:

    var a = {
      b: 42,
      c: function() {
          return this;
         }
    }
    
    console.log((a.c)());
    console.log((a.c || [])());

Why is the return value (object bound to this) of (a.c)() different from (a.c || [])()?

0 Answers
Related