Javascript Closure Explained - In under 3 minutes!

preview_player
Показать описание
This tutorial gives an example function that itself returns a function which can use variables defined in the parent scope. The reason the inner function can do this is due to the closure functionality that Javascript provides.

Written in the Visual Studio Code editor we show how to call this function and that it does indeed output the correct values (using Quokka to display the results inline within VSCode)

This is meant to be a quick overview of Closure and hence condensed into the 3 minute window. Closure itself is used in many different scenarios within Javascript and you should look into further reading to gain a more in depth understanding. But for an initial idea this video is perfect!
Рекомендации по теме
Комментарии
Автор

Watched it twice, feels like I've grasped it with your help.
Thanx a lot and have a good day!

everlastiez
Автор

This example is unforgettable.Closure simplified indeed.

erasmasngandu
Автор

Can someone tell what extension he uses, that shows values instantly on the right in the comments?

vitalino
Автор

What extension are you using to give you the variable value and total?

GorillaDev
Автор

Can you explain complex examples for closures?

davidfromnorth