Using Immediately Invoked Function Expressions (IIFEs)

preview_player
Показать описание
Immediately Invoked Function Expressions or IIFEs are a staple of JavaScript development, but can sometimes be confusing to the uninitiated. In this tutorial we will cover IIFEs so that anyone can understand them.

For more resources on JavaScript:

Full personalized courses on JavaScript:

Tutorials referred to in this video:
Рекомендации по теме
Комментарии
Автор

Thank you for clarifying the IIFE construct as also for giving the real world scenario on how you can use it. Great video!

JavierCarrion
Автор

you are a great teacher. I follow you for long

rakibul
Автор

Douglas Crockford
said when you invoke an IFFE like so: (function(){
console.log(5 * 5);
})(); that it looks like a pair of dog balls hanging lol that a more intuitive way would be to wrap it in parenthesis. (function(){...}()); But anywho great tutorial !

ChrisTian-oxnr
Автор

Cool, but... I get the workings but given a script doesn’t need the code to be wrapped in functions anyway, I.e. you could just have “console.log(5*5);” in a script file all by itself and it would execute every time the page loads (I.e. immediately) what’s the advantage of wrapping it in “function” etc.?
Very probably a dull question ;o)

m
Автор

Hello,
Does the advanced JS course on udemy cover things that would help me in backend JS programming, specifically Node.js, so things like callbacks, closures, and other advanced stuff?
Thanks for the Youtube videos.

faizanrahman
Автор

can u also please do some tutorials on ajax-pure javascript-json-php load data while scrolling down, there tons of tutorials useing mysql and jscroll or kqueries, can we do with simply pure javascript without any of those jquery or jscrolls, please, pure clean javascript. i know we need ajax, php and json as well,

ilhomhuja
Автор

Unfortunatly very seldom find IIF with params...

valikonen
Автор

The concepts are not exactly same what is shown in the video. So It's not a good guide.

DipenduDasDip