🔰IIFE

Immediately-Invoked Function Expression

JSconceptsexpressionfunction expression ⟩ IIFE

immediately-invoked function expression

a closure (or IIFE) can be used to create a scope to hide variables/functions.

break/continue won't operate across an IIFE function boundary to control an outer loop/block.

📗 You Don't Know JS Yet: Scopes & Closrues

if the code you need to wrap a scope around has return, this, break, or continue in it, don't use a function/IIFE(which has its own function boundary), use a block instead❗️

📗 You Don't Know JS Yet: Scopes & Closrues

Last updated