Using the global this in a function object

by de Montalembert Jonathan

JavaScript

const a = {
  b: (arg) => {
    console.log(arg, this)
  },
  c: function(arg) {
    console.log(arg, this)
  }
}
console.log("===== SAMPLE ARROW FN  =====");
a.b(5);
(0, a.b)(5);
console.log("===== SAMPLE STANDARD FN  =====")
a.c(5);
(0, a.c)(5)