Functions ========= console.log(a) ==> Undefined var a = 100; console.log(a); ==> 100 Function Hoisting: ================== ==> we can call the function before the definition is called as "Function Hoisting". searchHnadler("Searching for 'JavaScript Function Hoisting'..."); // function call // function definition function searchHnadler(message){ console.log(message); } // searchHnadler("Searching for 'JavaScript Function Hoisting'..."); // function call ================================================== Self-Invoking Functions: ======================== ->The function can call itself for only one time to make execute the task. Syntax: (function nameOftheFunction(){ // logic; })(); (function greets(name){ console.log("Welcome to Ashok IT ",name); })("Ravi"); // greets(); ================================================ (function countdownTimer(){ const offerEndTime = new Date().getTime() + 60 * 60 * 1000; function updateTimer(){ const currentTime = new Date().getTime(); const timeRemaining = offerEndTime - currentTime; if(timeRemaining > 0){ const minutes = Math.floor((timeRemaining % (1000 * 60 * 60))/(1000 * 60)); const seconds = Math.floor((timeRemaining % (1000 * 60))/1000); console.log(`Offer ends in: ${minutes}m ${seconds}s`); } else{ console.log("The offer has ended."); clearInterval(timeInterval); } } const timeInterval = setInterval(updateTimer,1000); })();