JavaScript IIFE (Immediately Invoked Function Expressions)

preview_player
Показать описание
A brief explanation about Immediately Invoked Function Expressions (IIFE). The video also discusses the difference between function declarations and function expressions and a limited explanation of how you could use an IIFE.
Рекомендации по теме
Комментарии
Автор

7 year old video and still one of the easiest to understand. thank you

naugustus
Автор

You are GREAT. My whole GW holidays, possibly the rest of my life, is featured by your JS tutorials.

rotrose
Автор

straight to the point. man I freaking love this channel.

osamagamal
Автор

Great explanation, simple and useful!

korhad
Автор

thank you! I think I finally understand it!

antoniomartinez
Автор

> function fun1(){return "hello"}()
Uncaught SyntaxError: Unexpected token ')'
> function fun2(x){return x*x}(5)
5
> 0, function fun3(x){return x*x}(5)
25

As expected in first case I get error as I didn't use paranthesis. But how the second case and third case get executed?

dumchik
Автор

Thanks for explaining the hoops javascripters jump through to simulate namespaces. Doh... :)

artrahman
Автор

is a function inside of a map method a IIFE function cauz it enclosed by the parentheses tho

romeojoseph
Автор

hi Steve,
why would someone use IIFE? why do I write a function that only can be run once, isn't it contradicting the factor of reusability of a function. Can you state any use case for IIFE?

jasbindarsingh
Автор

great tutorial;)
you put strings in the keys inside key value pair. How is it different from not putting the strings? it still works without strings.

jkk
Автор

Very low audio. Sounds like you are whispering.

UlyssesAlexandreAlves
Автор

sound is too low, I can barely hear you !

fahemzoldyck