Closures - Beau teaches JavaScript

Closures - Beau teaches JavaScript

freeCodeCamp.org

7 лет назад

74,709 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Av
Av - 09.09.2023 02:12

Thanks Beau,. After 2 years as a JS engineer, finally understood closures watching a 6 years old video

Ответить
Susmoy S
Susmoy S - 21.12.2022 19:58

what is the use case of this?

Ответить
Vahe
Vahe - 19.07.2022 02:42

Wow, just spend at least the past 2 hours trying to understand closures watching a few 20+ minute videos, reading up, etc.

This video is literally the shortest content out of any of them but it is the only one that is clear and logical and it definitely helped me understand closures.

Thank you!

Ответить
Rob Tangled
Rob Tangled - 18.06.2022 05:26

The only problem I notice with Beau's teaching method is that he goes from 20km/h to 150km/h in one second. If you try to play it at 0.75x, sometimes it will feel too slow, but if you play it at 1x, he speaks too fast 30% of the time.

Ответить
Dmitri K
Dmitri K - 04.04.2022 18:49

so, the private variable in the parent container function is modified by the child container function?
Ex.
function parentFunction() {
let counter = 0
function childFunction() {
console.log("counter",counter)
console.log("counter increment",counter+=1)
}
return childFunction
}

let result = parentFunction()
result()
result()
result()

Ответить
Scott Smyth
Scott Smyth - 24.02.2022 02:00

Great explanation thanks!

Ответить
min11benja - Blog
min11benja - Blog - 26.06.2021 00:13

It's when a function or variable has access to other variables within the scope or the environment it was created in. They are sometimes used to emulate private methods. Which can only be called by other methods in the same class. Since JS does not have a native way of doing this.

Ответить
Abdullah Gumel
Abdullah Gumel - 03.06.2021 23:09

So basically it's like a character in a sandbox game having access to all the stuff in their environment they exist within

Ответить
ulTimateLokal
ulTimateLokal - 13.05.2021 15:07

ugh my brain hurts.

Ответить
neahnderthal
neahnderthal - 02.12.2020 17:49

would greatly appreciate if you talk louder instead of adjusting my speaker every time :(

Ответить
Christian Fall
Christian Fall - 29.09.2020 11:36

Uh. What!?

Ответить
CentrumSaiyan
CentrumSaiyan - 31.08.2020 19:24

Thanks, I have watched several great tutorial channels and yet, closure is still something i'm not confident talking about.

Ответить
Ken Skversky
Ken Skversky - 19.08.2020 08:56

Way too confusing of a presentation

Ответить
Bulldawg
Bulldawg - 13.08.2020 02:50

Yes, one of the better explanations I've come across, too ... Concise, too ...

Ответить
#hashtagTrends
#hashtagTrends - 11.08.2020 21:24

Thank you!

Ответить
Grahfx
Grahfx - 11.05.2020 12:31

It looks like a class emulation no ? You just instantiate an object called counter that has a property privateCounter and 3 methods in it.

Ответить
Ashton Christopher
Ashton Christopher - 04.05.2020 06:32

Dude...you cant use jargon with beginners. This was terrible

Ответить
SWARM DESIGN SOLUTIONS
SWARM DESIGN SOLUTIONS - 26.03.2020 18:04

this is by far the best video - thanks

Ответить
Bilja M
Bilja M - 24.02.2020 15:31

Thank you! I was really confused by closures.

Ответить
Oleg Perchyk
Oleg Perchyk - 14.02.2020 05:51

I finally understand!

Ответить