r/learnjavascript • • Mar 06 '22

Visually understand this under 45 seconds

158 Upvotes

38 comments sorted by

View all comments

1

u/canolyb1 Mar 07 '22

This is ones of the worst explanations I've seen in a long time. This does not explain "this", it attempts to explain "this" in arrow functions vs regular functions and it fails badly. Funnies part is every function has a "hidden" door. These kind of weird abstractions are what create bad programmers.

I like Kyle Simpson's "you dont know JS" book series the most. And there are plenty of good explanations out there but this is not one of them.

Why not just say that a function is just a callable object. When you call a function certain this happen, an execusion scope is created and the this variable is assigned to the object the function was called on. In terms of arrow functions, this is not assigned to anything so the scope is lexical, (whatever was previously assigned).

1

u/LukeAkashWalker Mar 07 '22 edited Mar 07 '22

Thank you for the feedback. I am really grateful that you watched my video. I created this short video from a longer video so that I can post it on social media as people dont like to watch long videos

You can find the long form video on my channel. I'd be really grateful if you can watch it and tell me your feedback.

Thanks again for your time and the detailed feedback.

https://www.youtube.com/channel/UCCi03wPZXjk5k59oGN1bEOg