JavaScript Interview Question: How Does "this" Work?
Short answer: for regular functions, this is decided by how the function is called , not where it's defined. Arrow functions don't have their own this ; they use the this of the surrounding scope. The rules, in order new : new User() - this is the new object....