iife (immediately invoked function expression)
Sahifa ko'rinishi (5 sahifa)
Pastga aylantiring 👇
Ko'proq o'qimoqchimisiz?
Barcha 9 sahifani Telegram orqali bepul yuklab oling.
To'liq faylni yuklab olish"iife (immediately invoked function expression)" haqida
tutorial 3: iife, context, new 3.1 iife (immediately invoked function expression) an iife is a function that runs as soon as it is defined. it helps avoid polluting the global scope by encapsulating code. (function () { let secret = "this is hidden"; console.log(secret); // output: this is hidden })(); // console.log(secret); // error: secret is not defined real-world example : initializing a library or module without exposing internal variables. (function () { let apikey = "12345"; function getapikey() { return apikey; } console.log(getapikey()); // output: 12345 })(); 3.2 context (this) the this keyword refers to the context in which a function is called. its value depends on how the function is invoked. 3.2.1 implicit binding when a function is …
Bu fayl PPTX formatida 9 sahifadan iborat (231,1 KB). "iife (immediately invoked function expression)"ni yuklab olish uchun chap tomondagi Telegram tugmasini bosing.