r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

Show parent comments

0

u/[deleted] May 28 '19

[deleted]

1

u/[deleted] May 28 '19

can you give me an example of how running

let o = { f: function() { console.log(this); } };

o.f();

prints out anything except the Object o?

Also, to your first point, yes you can change the context at the call point with call/apply/bind, however, am I wrong to say that this applies to the closure created by the function in non call/apply/bind cases?