In the browser, this
in classic and arrow functions expectedly returns the Windows object:
<script>
function testClassic() {
console.log(this);
}
const testArrow = () => {
console.log(this);
}
testClassic();
testArrow();
</script>
But in Node, this
is the global object only in the classic function but this
is empty in the arrow notation function. Why is that?