JavaScript Closures

preview_player
Показать описание
In this video we'll learn about JavaScript closures. We'll start by reviewing some of the properties that functions in JavaScript have and then we'll start working on two examples.

First example is going to show us that we can access global variables (declared outside function's body) in our function and that itself is a simplest example of a closure.

Second example is going to show us how we can use closures and leverage their powers. We're going to be able to protect/hide some data and only expose the functionality that we want. We are also going to use some real world example problem that should hopefully make a ton of sense for you!

Note: I did upload it and then took it down because audio setting was rather low, hence me re-uploading it again.

Link to repository:

Enjoying my videos and want to buy me a coffee?
Рекомендации по теме
Комментарии
Автор

Well this is a decent example to get an understanding of closure .I was looking for something more from a 40mins+ tutorial .still well explained .

satyajeetkumarjha
Автор

Thanks Codewrokr! for this awesome video. It really helped me understand what is "Closure"

Ramesharr
Автор

Amazing video! Thank you so much man... Best explanation of this concept...

MYKhanFromThes
Автор

Great stuff, CodeWorkr.
Prototypal inheritance is another concept that can be a bit tough to wrap one's head around.

SleekCollins
Автор

Very good, thanks. Waiting for new videos

ДенисКозлов-гч
Автор

I now understand that Closures are very simple things than I thought

husniddinqurbonboyev
Автор

congra!
please plus videos in this series.

robsonmvieira
Автор

32:04 My A-ha moment. Great explanation.

arturdomanski
Автор

Just a question, in 03_solution.js, at 32:00, you add voteDogs() 2 times and "Dogs current Votes" output 1 and after 2, but in voteDogs function dogsVotes variable is initalizing to 0 every time the function is called so why this variable is incremented, but not return 1 all the time ?

nightwatch
Автор

Hi CodeWorkr, haw are you man? any news? we missed your tutorials, hope you come back asap ;)

mohamedbenlakhrech
Автор

we can vote for dogs, cats, dolphins, and Vucic

overflea
join shbcf.ru