YUNOVA · JavaScript

Module 12: JavaScript Andar Se Kaise Chalti Hai

Notes for offline study · 30 November 2026

JavaScript mein execution context aur call stack kya hota hai

Key points

  • execution context वह माहौल है जिसमें code चलता है; पहले global context बनता है।
  • हर function call पर नया context बनकर call stack में ऊपर रखा जाता है।
  • call stack LIFO है: जो सबसे बाद में आया वह पहले ख़त्म होकर हटता है।

JavaScript mein closure kya hota hai

Key points

  • closure में अंदर वाला function बाहर वाले function के variables याद रखता है।
  • बाहर वाला function ख़त्म होने के बाद भी वे variables बचे रहते हैं।
  • counter जैसे private data बनाने में closure का use होता है।

JavaScript mein event loop kaise kaam karta hai

Key points

  • event loop देखता है कि call stack खाली है, फिर queue से अगला काम उठाता है।
  • Promise के callbacks microtask queue में जाते हैं और setTimeout वाले task queue में।
  • microtasks पहले चलते हैं, इसलिए setTimeout 0 भी Promise.then के बाद चलता है।

JavaScript mein call apply aur bind kaise use karein

Key points

  • call और apply function को चुने हुए this के साथ उसी समय चलाते हैं।
  • call arguments अलग-अलग लेता है, apply उन्हें एक array में लेता है।
  • bind तुरंत नहीं चलाता; this जुड़ा हुआ नया function लौटाता है।

JavaScript mein prototype kya hota hai

Key points

  • हर object का एक prototype होता है, जिससे वह properties और methods उधार लेता है।
  • property object में न मिले तो JavaScript prototype chain में ऊपर ढूँढती है।
  • array के push जैसे methods Array.prototype से आते हैं।

Free on YUNOVA · yunova.in · Sign in to add your own lesson notes to this sheet.