Question #105

Author: admin
tags: JavaScript  
// type="module"

const obj1 = {
  num: 1,
  method: () => {
    console.log(this.num);
  },
};

const obj2 = {
  num: 2,
  method: obj1.method,
};

obj2.method();
What will the console output be?
1
2
Nothing. There will be an error.
Arrow functions do not have their own this.
Arrow functions take this from the outside.
It this question the arrow function is invoked in a global context, not inside other outer function. This is a module, so global this is undefined.
Rate the difficulty of the question:
easyhard