🚀 Day 1/100 — Starting My 100 Days of JavaScript & TypeScript Today I’m starting a 100 Days of JavaScript & TypeScript challenge. The goal isn’t just to “learn JS again.” It’s to deeply understand how JavaScript works under the hood and apply it the way production systems and product engineers actually use it. Over the next 100 days I’ll be focusing on: • JavaScript fundamentals (execution context, event loop, closures) • Advanced TypeScript for scalable systems • Real-world utilities used in production • Performance & architecture patterns • Building small product-ready systems Why this challenge? Because great product engineers don’t just write code — they understand how systems behave, scale, and fail. So each day I’ll share: ✔ What I built ✔ The concept behind it ✔ How it applies to real-world products 📌 Today’s Topic: JavaScript Execution Context Before any JavaScript code runs, the engine creates something called an execution context. Think of it as the environment where code is evaluated and executed. Each execution context contains: • Variable Environment – where variables and functions live • Scope Chain – determines variable access • this Binding – context of execution Example: var name = "Engineer"; function greet() { var message = "Hello"; console.log(message + " " + name); } greet(); When this runs: 1️⃣ Global Execution Context is created 2️⃣ Variables and functions are stored in memory 3️⃣ A Function Execution Context is created when greet() runs Understanding this concept is key to mastering: • Closures • Hoisting • Async behavior 💡 Engineering Insight Many tricky JavaScript bugs come from misunderstanding execution context and scope, especially in async code and callbacks. Mastering this concept makes debugging far easier in large production codebases. ⏭ Tomorrow: How the JavaScript Event Loop Actually Works #100DaysOfCode #JavaScript #TypeScript #SoftwareEngineering #ProductEngineering
100 Days of JavaScript & TypeScript: Execution Context
More Relevant Posts
-
--JavaScript vs TypeScript simplified-- Now with easier front end development using Models, i think it is important we know the difference. JavaScript is everywhere. TypeScript is everywhere JavaScript grows up. Yet many developers still confuse what actually changes when you move to TypeScript. Let’s break it down simply. 👇 👉 JavaScript: The Flexible Language 👉 Dynamically typed language 👉 Runs directly in the browser and Node.js 👉 Errors usually appear at runtime 👉 Faster to start with minimal setup 👉 Great for rapid prototyping and small apps 🔹 TypeScript: JavaScript with Superpowers 🔹 Statically typed superset of JavaScript 🔹 Code is compiled into JavaScript before running 🔹 Errors detected during development (compile time) 🔹 Better tooling, autocomplete, and IDE support 🔹 Ideal for large scale and maintainable applications ✅ Key Differences at a Glance ✅ Typing → JavaScript: Dynamic | TypeScript: Static ✅ Compilation → JavaScript: Directly runs | TypeScript: Compiled to JS ✅ Error Detection → JavaScript: Runtime | TypeScript: Compile-time ✅ Scalability → JavaScript: Harder in large apps | TypeScript: Designed for it ✅ Tooling → JavaScript: Limited | TypeScript: Excellent IDE support < When Should You Use What? > < Use JavaScript when building quick prototypes or simple scripts > < Use TypeScript when building large applications or teams working on the same codebase > < Use TypeScript when you want safer refactoring and fewer runtime bugs > The reality today: Most modern frameworks (Angular, Next.js, NestJS, React projects) are moving toward TypeScript-first development. Because catching bugs before running the code saves hours of debugging later. If you already know JavaScript, learning TypeScript usually takes just a few days — but improves your code quality massively. Are you writing JavaScript or TypeScript in your current projects? 👇 #JavaScript #TypeScript #WebDevelopment #SoftwareEngineering #Programming #Developers #Coding #FrontendDevelopment #BackendDevelopment #AI #ArtificialIntelligence #AIEngineering #MachineLearning #AIForDevelopers #TechInnovation #FutureOfAI
To view or add a comment, sign in
-
-
🚀 Day 2/100 — How the JavaScript Event Loop Actually Works Continuing my 100 Days of JavaScript & TypeScript challenge. Today I explored one of the most important concepts in JavaScript: The Event Loop. JavaScript is single-threaded, which means it can execute only one task at a time. But in real applications we handle: • API requests • timers • user interactions • file operations So how does JavaScript manage all of this without blocking the application? 👉 The answer: The Event Loop ⸻ 📌 Core Components JavaScript concurrency relies on three main parts: 1️⃣ Call Stack Where functions are executed. Example: function greet() { console.log("Hello"); } greet(); The function goes to the call stack, runs, and then exits. ⸻ 2️⃣ Web APIs Provided by the browser or runtime. Examples: • setTimeout • fetch • DOM events These operations run outside the call stack. ⸻ 3️⃣ Callback Queue Once an async task finishes, its callback is placed in the queue. Example: console.log("Start"); setTimeout(() => { console.log("Timeout finished"); }, 0); console.log("End"); Output: Start End Timeout finished Even with 0ms, the callback waits until the call stack is empty. ⸻ ⚙ Role of the Event Loop The event loop continuously checks: 1️⃣ Is the call stack empty? 2️⃣ If yes → move a task from the queue to the stack This mechanism allows JavaScript to handle asynchronous operations efficiently. ⸻ 💡 Engineering Insight Understanding the event loop is critical when working with: • async/await • Promises • performance optimization • avoiding UI blocking Many real-world bugs happen because developers misunderstand how async tasks are scheduled. ⸻ ⏭ Tomorrow: Microtasks vs Macrotasks (Why Promises run before setTimeout) #100DaysOfCode #JavaScript #TypeScript #WebDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Day 10 of My JavaScript Journey ✨Today I explored how JavaScript actually works behind the scenes — and honestly, it changed the way I look at code completely 🤯 Here’s what I learned 👇 🧠 How JavaScript Code RunsJavaScript doesn’t just execute line by line — it first creates an Execution Context which manages everything. ⚙️ Execution Context Phases1️⃣ Memory Allocation Phase Variables get stored with undefined Functions are stored completely 2️⃣ Execution Phase Code runs line by line Values get assigned and functions execute 📦 Call Stack & Execution Flow JavaScript uses a Call Stack to manage function calls Each function creates its own execution context Stack follows LIFO (Last In, First Out) 💾 Stack vs Heap Memory Stack → Stores primitive values (fast ⚡) Heap → Stores objects (reference-based 🧩) 🤖 Interpreter BehaviorJavaScript reads and executes code step by step using an interpreter — not compiled like some other languages. ❓ Why undefined Appears?Because during memory phase, variables are declared but not initialized yet. ⬆️ Hoisting Explained var is hoisted with undefined Functions are fully hoisted let & const are hoisted but stay in Temporal Dead Zone (TDZ) ❌ 🚫 Temporal Dead Zone (TDZ)You can’t access let & const variables before initialization — it throws an error. ⚠️ Function Expressions vs Hoisting Function declarations → hoisted ✅ Function expressions → behave like variables ❌ 💡 Key TakeawayUnderstanding execution context, memory, and hoisting makes debugging WAY easier and helps write cleaner code 🔥 📌 Slowly moving from writing code → to understanding how it actually works inside #JavaScript #WebDevelopment #MERNStack #CodingJourney #LearnToCode #FrontendDevelopment #DeveloperLife
To view or add a comment, sign in
-
-
Keeping up with JavaScript in 2026 🏃♂️ A big part of this overview by Chris Coyier (Frontend Masters) focuses on how JavaScript itself is evolving through ECMAScript. The 2025 edition brings incremental but meaningful improvements, and the 2026 pipeline already shows where the language is heading with cleaner APIs and better consistency. Beyond the language, the ecosystem keeps moving fast. Bun keeps gaining traction as a runtime, Vite remains dominant on the tooling side, and frameworks keep exploring new patterns around server-first and reduced client-side JavaScript. A quick read to stay aligned with both the present and near future of JavaScript. https://lnkd.in/edeS58kd
To view or add a comment, sign in
-
🚀 JavaScript Concepts Series – Day 9 / 30 📌 Promises & Async/Await in JavaScript 👀 Let's Revise the Basics 🧐 Understanding Promises & Async/Await is key to handling asynchronous operations cleanly and efficiently. They help you write non-blocking code without callback hell. 🔹 Promises A Promise represents a value that may be available now, later, or never States: Pending → Resolved → Rejected const promise = new Promise((resolve, reject) => { setTimeout(() => resolve("Done"), 1000); }); promise.then(res => console.log(res)) .catch(err => console.log(err)); 🔹 Async/Await Syntactic sugar over promises Makes async code look like synchronous code async function fetchData() { try { const res = await promise; console.log(res); } catch (err) { console.log(err); } } 🔹 Why Use It? Cleaner and readable code Better error handling with try...catch Avoids callback hell 💡 Key Insight Promise → Handles async operations async/await → Makes it readable await → Pauses execution (non-blocking) Mastering this helps you work with APIs, handle data, and build real-world applications efficiently. More JavaScript concepts coming soon. 🚀 #javascript #js #webdevelopment #frontenddeveloper #coding #programming #developers #softwaredeveloper #learnjavascript #javascriptdeveloper #codinglife #devcommunity #webdev #reactjs #mernstack #codingjourney #codeeveryday #developerlife #100daysofcode #techlearning #asyncjs #promises
To view or add a comment, sign in
-
-
What to actually use instead of any in TypeScript. The problem is, any basically turns TypeScript back into JavaScript. It kills your autocomplete, disables type checking, and spreads through your codebase like a virus. So, what should you use when things get complicated? 1. Use unknown (The responsible sibling) Think of unknown as a safer any. You can assign anything to it, but TypeScript will strictly stop you from using its properties or methods until you explicitly check what it is (type narrowing). 2. Use Record<K, V> for dynamic objects Need an object where you don't know the exact keys yet? Don't just type data: any. Use Record<string, unknown>. You keep the flexibility of dynamic keys without losing your safety net. 3. Use Generics <T> for reusable logic Writing a helper function? Instead of accepting any and returning any, use a generic. It tells the compiler: "I don't know the exact type yet, but whatever goes in, comes out with the exact same shape." and Zod or Valibot for API responses If data is coming from the outside world, any is a ticking time bomb. Use a schema library at the boundary. It validates the data at runtime and automatically infers strict TypeScript types for you. TypeScript is an amazing tool, but you're paying a lot of setup tax just to write plain JavaScript if you abuse any. #TypeScript #WebDevelopment #Frontend #JavaScript #CleanCode #React #WebDev
To view or add a comment, sign in
-
-
Most JavaScript developers think they understand equality… until this happens: {} === {} // false And suddenly… nothing makes sense. Let me show you what’s REALLY happening 👇 In JavaScript, not all data is equal. 👉 Primitives (numbers, strings…) are stored by value 👉 Objects are stored by reference (in memory) So when you compare objects, you're NOT comparing their content… You're comparing their addresses. Now here’s where things get interesting 🔥 JavaScript doesn’t just compare values… It actually transforms them behind the scenes using something called: 👉 Type Coercion Example: "5" - 1 // 4 Why? Because JS silently converts "5" → number. But what about objects? 🤔 const obj = { id: 105 }; +obj // NaN ❌ JavaScript doesn’t know how to convert it. Except… sometimes it DOES 😳 const t1 = new Date(); const t2 = new Date(); t2 - t1 // works ✅ Wait… how did that happen?! This is where things go from “JavaScript” to magic 🧠✨ Behind the scenes, JS uses: 👉 Symbol.toPrimitive A hidden mechanism that tells the engine: “Hey, if you need to convert this object… here’s how to do it.” And here’s the crazy part 👇 You can control it yourself. const user = { [Symbol.toPrimitive](hint) { return 105; } }; +user // 105 ✅ This is called: 👉 Metaprogramming You’re not just writing code… You’re controlling how the language itself behaves. 💡 Why this matters? Because: You avoid weird bugs You understand how JS REALLY works You level up from “writing code” → “engineering behavior” And now you understand why tools like TypeScript exist… 👉 To protect you from all this hidden complexity. 🚀 Final thought: Most developers try to avoid JavaScript quirks… But the best developers? They understand them… and take control. #JavaScript #Frontend #WebDevelopment #Programming #SoftwareEngineering #TypeScript #CleanCode #100DaysOfCode #MERNStack #CodingTips #LearnToCode
To view or add a comment, sign in
-
-
Many developers and students often get confused between JavaScript code execution for synchronous and asynchronous code. I was revisiting these fundamentals today and thought of sharing a simple breakdown that helped me connect all the dots. Here’s the Actual Flow Behind Node.js Execution JavaScript is Single-Threaded JavaScript runs on a single thread, meaning it executes one task at a time. This keeps things simple and avoids complex concurrency issues. But then the question is — How does Node.js handle multiple requests efficiently? That’s where V8, Event Loop, and libuv come into play. V8 Engine — The JavaScript Executor V8 is the engine that executes JavaScript code. It converts JavaScript into machine code. Handles synchronous code execution, so whenever sync code appears, It goes directly to Call Stack, V8 executes it immediately What Happens When Async Code Appears? When Node.js encounters async code like: setTimeout, File read, Database calls, API requests Instead of blocking execution, It sends async tasks to libuv libuv (C-Libarary) — The Background Worker libuv handles: Async I/O operations Thread pool tasks Event loop management Once async task completes: Callback goes to Callback Queue Event Loop — The Traffic Manager Event Loop continuously checks: Is Call Stack empty? Is there anything in Callback Queue? If both conditions satisfy: Event Loop pushes callback to Call Stack and V8 executes callback Final Flow Summary Sync Code → Call Stack → V8 executes Async Code → libuv Task Completed → Callback Queue Event Loop checks → Call Stack empty Callback → Call Stack V8 executes callback Understanding this core flow clears most of the confusion around synchronous vs asynchronous JavaScript in Node.js. #NodeJS #JavaScript #BackendDevelopment #EventLoop #V8 #libuv #AsyncProgramming #WebDevelopment #Learning #SoftwareEngineering
To view or add a comment, sign in
-
-
Best Rust Tools for JavaScript Developers: 2026 Ecosystem Guide The architectural foundation of the JavaScript ecosystem has undergone a profound and irreversible transformation. For years, the prevailing philosophy dictated that JavaScript tooling should be written in JavaScript. https://lnkd.in/gavkaDvm
To view or add a comment, sign in
-
Most developers use TypeScript to add types to JavaScript. Senior developers use TypeScript to make entire categories of bugs impossible. 5 advanced patterns that actually matter in production 👇 Instead of "any" → Use unknown + type guards any disables the type system entirely. unknown forces you to verify the type before using it. → function parse(data: unknown) { → if (typeof data === string) { return data.toUpperCase() } → throw new Error(Unexpected type) → } Instead of repeating similar types → Use Utility Types → Partial<T> — makes all properties optional → Required<T> — makes all properties required → Pick<T, K> — selects a subset of properties → Omit<T, K> — excludes specific properties → Record<K, V> — builds a typed key-value map Define once. Derive everywhere. One source of truth. Instead of hardcoding string literals → Use const assertions → const ROLES = [admin, editor, viewer] as const → type Role = typeof ROLES[number] Change the array — the type updates automatically. Zero drift. Instead of messy overloaded functions → Use discriminated unions → type Shape = → | { kind: circle; radius: number } → | { kind: rectangle; width: number; height: number } Add a new Shape and forget to handle it — TypeScript warns you. The compiler becomes your code reviewer. Instead of repeating validation logic → Use branded types → type UserId = string & { readonly brand: UserId } → type OrderId = string & { readonly brand: OrderId } → function getOrder(userId: UserId, orderId: OrderId) { ... } Passing an OrderId where a UserId is expected is now a compile error — not a runtime bug. TypeScript is not just about autocomplete. Used well, it makes illegal states unrepresentable. Which of these patterns are you already using in production? 👇 #TypeScript #SoftwareEngineering #FullStack #FrontendDevelopment #WebDevelopment #JavaScript
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development