Day 8/30 of my #JavaScriptChallenge
Saturdays & Sundays slow me down, but today I practiced:
Functions → built a Celsius → Fahrenheit converter (if/else).
Switch statements → made a card counting assistant .
#30daysjscertification
Day 24 of #JavaScriptChallenge by @ChaiCodeHQ@Hiteshdotcom
• Learned about Execution Context & Call Stack
• JS starts with Global Execution Context
• Each function creates its own context
• Two phases: Memory & Execution
• Managed by Call Stack (LIFO)
Day 23 of #JavaScriptChallenge by @ChaiCodeHQ@Hiteshdotcom
Learned IIFE (Immediately Invoked Function Expression)
• Executes immediately after creation
• Avoids global scope pollution
• Can be named or anonymous
• Pass params → ((name)=>{})(‘Nausheen’)
• Always end with ;
Day 22 of #JavaScriptChallenge by @ChaiCodeHQ@Hiteshdotcom
- this & Arrow Functions in JS
-this depends on how a function is called
- Arrow functions inherit this (lexical scope)
- Node.js → this = {} | Browser → this = window
- Explicit return → {} | Implicit return → no {}
Day 21 of #JavaScriptChallenge by @ChaiCodeHQ@Hiteshdotcom
Scope & Hoisting in JS
🔹 Inner → can access outer vars
🔹 Outer → can’t access inner vars
🔹 Function declarations → hoisted
🔹 Function expressions / arrow → not hoisted
Know your scopes to avoid tricky bugs!
Day 18 of #JavaScriptChallenge by @ChaiCodeHQ@Hiteshdotcom
Learnt how functions work declaring, calling, passing parameters, using default values like function loginUserMessage(username="sam"), returning values, and checking missing arguments with if(!username).
#ChaiAurCode