🚀 Just Built a Random Advice Generator using JavaScript & API! I recently built a small project to practice JavaScript API integration. This project fetches random advice using the Advice Slip API and displays it in a simple responsive UI. 🔹 Features • Fetches advice using Fetch API • Uses Async / Await for API handling • Button loading state while fetching data • Random background color change 🎨 • Fully responsive design 📱 🛠 Tech Stack HTML • CSS • JavaScript • Fetch API 📡 API Used https://lnkd.in/dhQVZzs9 🌐 Live Demo 👉 https://lnkd.in/dPePU2n5 💻 GitHub Repository 👉 https://lnkd.in/dJ7nNPCe This project helped me improve my understanding of JavaScript API calls, async programming, and DOM manipulation. I’ll continue building more projects to strengthen my frontend development skills. #javascript #webdevelopment #frontenddevelopment #api #100DaysOfCode #coding
More Relevant Posts
-
🧠 Why does some JavaScript run instantly… and some runs later? Because JavaScript can be synchronous and asynchronous. 🔹 Synchronous JavaScript - JavaScript runs one line at a time. - Each task waits for the previous one to finish. Example: console.log("Start"); console.log("Middle"); console.log("End"); Output: Start → Middle → End ✅ Simple ❌ Can block execution 🔹 Asynchronous JavaScript - Some tasks don’t block execution. - They run in the background and return later. Example: console.log("Start"); setTimeout(() => { console.log("Async Task"); }, 2000); console.log("End"); Output: Start → End → Async Task 🔹 Why Async Exists Without async: - APIs would freeze the app - Timers would block everything - UI would become unresponsive 💡 Key Idea JavaScript is single-threaded, but it handles async using Web APIs + Call Stack + Event Loop (We’ll cover this next 👀) 🚀 Takeaway - Sync = step-by-step execution - Async = non-blocking execution Both are essential for real-world apps Next post: Event Loop Explained Simply 🔥 #JavaScript #AsyncJS #Frontend #WebDevelopment #LearnJS #Programming #LearningInPublic
To view or add a comment, sign in
-
-
💰 Built an Expense Tracker using JavaScript As part of strengthening my JavaScript fundamentals through projects, I built an Expense Tracker that lets users add and delete transactions, track balance, and manage income and expenses dynamically. This project helped me practice core concepts like: • DOM Manipulation • Event Handling • Form Validation • Array Methods (map, filter, reduce) • Dynamic UI Rendering • localStorage • State Management in Vanilla JavaScript Features of the app: ✅ Add new transactions ✅ Delete transactions ✅ Automatically update balance, income, and expense ✅ Store data in localStorage so data remains after refresh ✅ Show an empty state when no transactions are available ✅ Clean and responsive UI Tech Stack: HTML • CSS • JavaScript • localStorage API What I liked about this project is that it was not just about building a UI — it also made me think about data flow, calculations, and keeping the interface in sync with application state. This is part of my journey of revisiting JavaScript fundamentals by building projects before moving deeper into TypeScript, React, and full-stack development. Live Link:https://lnkd.in/gEwcBaqn GitHub Repo:https://lnkd.in/g5Pvvdyg #javascript #webdevelopment #frontenddevelopment #learninginpublic #coding
To view or add a comment, sign in
-
The map() function is one of the most commonly used methods in JavaScript — especially in React applications. It allows you to transform array data and return a new array. In this video, I explain: • How map() works internally • How it processes each element • How to modify values • Why it always returns a new array • Difference between map() and filter() Example: [1,2,3] → [2,4,6] map() is widely used for: • Rendering lists in React • Transforming API data • UI logic Understanding map is essential for writing efficient frontend code. 🎓 Learn JavaScript & React with real-world projects: 👉 https://lnkd.in/gpc2mqcf 💬 Comment Link and I’ll share the complete JavaScript roadmap. #JavaScript #ReactJS #FrontendEngineering #WebDevelopment #SoftwareEngineering #Programming #DeveloperEducation
map() Explained Simply
To view or add a comment, sign in
-
⚡ Day 7 — JavaScript Event Loop (Explained Simply) Ever wondered how JavaScript handles async tasks while being single-threaded? 🤔 That’s where the Event Loop comes in. --- 🧠 What is the Event Loop? 👉 The Event Loop manages execution of code, async tasks, and callbacks. --- 🔄 How it works: 1. Call Stack → Executes synchronous code 2. Web APIs → Handle async tasks (setTimeout, fetch, etc.) 3. Callback Queue / Microtask Queue → Stores callbacks 4. Event Loop → Moves tasks to the stack when it’s empty --- 🔍 Example: console.log("Start"); setTimeout(() => { console.log("Timeout"); }, 0); Promise.resolve().then(() => { console.log("Promise"); }); console.log("End"); --- 📌 Output: Start End Promise Timeout --- 🧠 Why? 👉 Microtasks (Promises) run before macrotasks (setTimeout) --- 🔥 One-line takeaway: 👉 “Event Loop decides what runs next in async JavaScript.” --- If you're learning async JS, understanding this will change how you debug forever. #JavaScript #EventLoop #WebDevelopment #Frontend #100DaysOfCode 🚀
To view or add a comment, sign in
-
Hoisting in JavaScript (and TypeScript) - Explained So You’ll Never Forget Ever saw this weird behavior? console.log(a); // undefined var a = 10; OR even worse: sayHello(); // Works! function sayHello() { console.log("Hello!"); } How is JavaScript using things before they are declared? 👉 That’s called Hoisting 🏠 Real-Life Example: Hotel Reception Imagine you walk into a hotel… "var" — Pre-registered Guest 📝 Your name is already in the system, but your room is not ready yet. 👉 You exist… but not fully ready 👉 So you get "undefined" "let" / "const" — Walk-in Guest 🚶♂️ You are NOT in the system yet. 👉 Try to access before check-in? ❌ “Sir, you are not registered!” (This is called Temporal Dead Zone) "function" — VIP Guest ⭐ Your room is already booked and ready! 👉 You can directly go in 👉 That’s why functions work before declaration Behind the scenes (Simple terms): JavaScript does 2 steps: 1️⃣ Memory Allocation Phase → Variables & functions are stored 2️⃣ Execution Phase → Code runs line by line Key Takeaways: ✔ "var" is hoisted (initialized as "undefined") ✔ "let" & "const" are hoisted but NOT initialized ✔ Functions are fully hoisted Pro Tip: Avoid confusion → Always declare variables at the top (or just use "let" / "const" properly) 💬 Have you ever faced a bug because of hoisting? #JavaScript #TypeScript #WebDevelopment #Frontend #Coding #LearnToCode
To view or add a comment, sign in
-
-
20 projects complete. 80 to go. Started this challenge a month ago - 100 JavaScript projects in 100 days to build a strong foundation before diving deeper into frameworks. First 10 projects: Counter, color flipper, tip calculator, quote generator, modal popup, accordion menu, todo list, digital clock, stopwatch, countdown timer. Projects 11-20 (took me more than 15 days, but consistency matters more than speed): ⚖️ BMI Calculator - Input validation and health category logic 🌡️ Temperature Converter - Multi-unit conversion (Celsius, Fahrenheit, Kelvin) 🔐 Random Password Generator - Customizable length and character types 🔤 Character Counter - Real-time tracking with remaining character display ❓ FAQ Collapse/Expand - Smooth animations and toggle functionality 🖼️ Image Slider - Navigation controls and auto-slideshow 📑 Tabs Component - Active state management and content switching 🍔 Navbar Toggle - Responsive mobile menu 🌓 Dark/Light Mode Toggle - Theme switching with localStorage persistence 📝 Form Validation - Real-time error messages for empty fields What's clicking now: First 10 projects were about basic DOM manipulation. Projects 11-20 took it up a notch - localStorage for data persistence, CSS variables for theming, smooth transitions. The dark/light mode project really helped me understand how CSS variables and transitions work together properly. Key learnings: ✅ localStorage for saving user preferences ✅ CSS variables for dynamic theming ✅ Transition effects for smooth UI changes ✅ Form validation without libraries My JavaScript foundation is getting stronger. When I go back to React, Vue, or Angular, I'll know exactly what's happening behind the abstractions. 🌐 CHECK OUT ALL LIVE PROJECTS HERE: 👉 https://lnkd.in/gHAUwuM3 💻 Source Code: https://lnkd.in/gexDJ7BY Progress: 20/100 (20% complete) Next 10 projects include scroll animations, progress bars, star ratings, toast notifications, and drag & drop functionality. Let's keep building. 🚀 #JavaScript #100DaysOfCode #WebDevelopment #FrontendDeveloper #LearningInPublic #VanillaJS
To view or add a comment, sign in
-
💡 Understanding How JavaScript Works Behind the Scenes. Excited to share a visual breakdown of how JavaScript executes code inside the browser and handles asynchronous operations. This helped me better understand how real-world web applications manage performance and responsiveness. ⚙️ Core Concepts Covered 🧠 JavaScript Execution • JavaScript Engine (Executes code) • Memory Heap (Stores variables & objects) • Call Stack (Handles function execution - LIFO) 🌐 Asynchronous Handling • Web APIs (setTimeout, fetch, DOM events) • Callback Queue (Stores async callbacks) • Event Loop (Manages execution flow between queue & stack) 🔄 Advanced Concepts • Promises (Pending → Fulfilled / Rejected) • Async/Await (Cleaner async code) • DOM Manipulation (Dynamic UI updates) 🏗 Key Takeaways • JavaScript is single-threaded but non-blocking • Event Loop plays a crucial role in async execution • Efficient handling of async tasks improves performance This concept is fundamental for building scalable and high-performance frontend applications 🚀 #JavaScript #WebDevelopment #Frontend #EventLoop #AsyncProgramming #Coding #Developer #LearningInPublic
To view or add a comment, sign in
-
-
Understanding the JavaScript Event Loop is a game changer for writing efficient asynchronous code. Many developers use setTimeout and Promise daily — but fewer truly understand what happens behind the scenes. Here’s a quick breakdown 👇 🔹 JavaScript is single-threaded 🔹 Synchronous code runs first (Call Stack) 🔹 Then all Microtasks execute (Promises, queueMicrotask) 🔹 Then one Macrotask runs (setTimeout, setInterval, DOM events) 🔹 The loop repeats 📌 Execution Priority: Synchronous → Microtasks → Macrotasks Example: console.log(1); setTimeout(() => console.log(2), 0); Promise.resolve().then(() => console.log(3)); console.log(4); ✅ Output: 1 → 4 → 3 → 2 Understanding this helps in: ✔ Debugging async issues ✔ Optimizing performance ✔ Writing better React applications ✔ Cracking frontend interviews I’ve created a simple infographic to visually explain the entire Event Loop process. If you're preparing for JavaScript or React interviews, mastering this concept is essential. 💬 Now Your Turn 👇 What will be the output of this code? console.log("A"); setTimeout(() => console.log("B"), 0); Promise.resolve().then(() => { console.log("C"); }); console.log("D"); 👨💻 Follow for daily React, and JavaScript 👉 Arun Dubey Drop your answer in the comments 👇 Let’s see who really understands the Event Loop 🔥 #JavaScript #FrontendDevelopment #ReactJS #WebDevelopment #EventLoop #CodingInterview
To view or add a comment, sign in
-
-
Most JavaScript developers use async/await every day without actually understanding what runs it. The Event Loop is that thing. I spent two years writing JavaScript before I truly understood how the Event Loop worked. Once I did, bugs that used to take me hours to debug started making complete sense in minutes. Here is what you actually need to know: 1. JavaScript is single-threaded but not blocking The Event Loop is what makes async behavior possible without multiple threads. 2. The Call Stack runs your synchronous code first, always Anything async waits in the queue until the stack is completely empty. 3. Microtasks run before Macrotasks Promise callbacks (.then) execute before setTimeout, even if the timer is zero. This catches a lot of developers off guard. 4. Understanding this helps you write better async code You stop writing setTimeout hacks and start understanding why certain code runs out of order. 5. It explains why heavy computations block the UI A long synchronous task freezes the browser because nothing else can run until the stack clears. The mindset shift: JavaScript is not magic. It follows a very specific execution order and once you see it clearly, you write code that actually behaves the way you expect. 🧠 The Event Loop is one of those concepts that separates developers who guess from developers who know. When did the Event Loop finally click for you? 👇 If this helped, I would love to hear your experience. #JavaScript #WebDevelopment #EventLoop #Frontend #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 JavaScript forEach vs map — Know the Difference Like a Pro! Many developers use forEach and map interchangeably… but they serve completely different purposes 👀 Let’s break it down 👇 🔹 forEach() 👉 Executes a function for each element 👉 Perfect for side effects (logging, updating UI, API calls) 👉 ❌ Does NOT return a new array 💡 Use it when you just want to do something, not transform data 🔹 map() 👉 Transforms each element 👉 ✅ Returns a new array 👉 Ideal for rendering lists (especially in React ⚛️) 💡 Use it when you want to create something new from existing data ⚡ Quick Rule to Remember: ➡️ Need a new array? → map() ➡️ Just looping? → forEach() 🧠 Pro Tip: Overusing forEach when you actually need map can make your code less clean and harder to scale! 💬 Which one do you use more in your projects — forEach or map? #JavaScript #WebDevelopment #FrontendDevelopment #ReactJS #ProgrammingTips #CodingLife #SoftwareDeveloper #LearnToCode #100DaysOfCode #DevCommunity
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