I am quite confused, as my knowledge of javascript seem to have been outdated. I remember that the following:
p = {
foo: function() {
console.log(this);
}
}
would have this
not bound unless you used new
to create a new instance with the object as prototype. Has this changed in recent years? It's been a very long time since I stopped coding in vanilla js so I might be wrong, or mixing different concepts together.