Javascript Flashcards
1
Q
IIFE
A
An immediately invoked function expression (IIFE) in JavaScript is a function that runs as soon as it is defined. It allows running a function while avoiding polluting the global namespace. [1]
An IIFE is defined by wrapping a function expression inside parentheses and calling it immediately.
2
Q
why so many async
A
different from python, in JavaScript , When a method is called, the calling thread won’t pause execution and wait for the method to complete before continuing.
This can lead to race conditions or unexpected behavior if you rely on the previous function’s result.