Just built a simple Head & Tail game using JavaScript 🎯 I’m currently learning how to connect: • Functions • Objects • localStorage • DOM manipulation This project helped me understand how data (like scores) can be saved, updated, and displayed on the screen in real time. Still learning, still improving but I’m starting to really understand how everything connects together 🔥 More projects on the way 🚀 #JavaScript #WebDevelopment #BeginnerDeveloper #CodingJourney #Frontend #BuildInPublic
More Relevant Posts
-
💻 JavaScript Array Methods – Hands-on Practice Completed Worked on some fundamental Array methods in JavaScript and practiced how they actually behave 👇 ✔️ Used push() and pop() to add/remove elements from the end ✔️ Used unshift() and shift() to work with elements at the beginning ✔️ Explored length to track array size ✔️ Understood the difference between slice() and splice() through practice 💡 Key takeaway: slice() does not modify the original array, while splice() directly changes it — this difference is really important while working with data. Practicing these basics is helping me build a strong foundation in JavaScript 🚀 #JavaScript #WebDevelopment #Frontend #CodingJourney #LearningByDoing
To view or add a comment, sign in
-
-
**AVOID JAVASCRIPT'S QUIET BUGS:** **Don't use ==, use ===** --- 🔺 **THE PROBLEM: == COERCION** ```js console.log([] == false); // prints true! 😅 ``` **The behind-the-scenes journey:** ``` [] ↓ (empty array) "" ↓ (string) 0 ↓ (number) false ↓ (boolean) 0 ``` Wait, why is that true? JavaScript silently converts types, leading to unexpected results. **This is confusing behavior!** --- 🔺 **THE FIX: STRICT EQUALITY** ```js console.log([] === false); // prints false! 🎉 ``` Uses strict comparison without hidden type conversions. **Predictable and safe.** --- 🔺 **NO HIDDEN CONVERSION!** --- **MAKING YOUR CODE PREDICTABLE: ALWAYS USE ===** Have you encountered confusing JavaScript type coercion? Share your experience! 👇 #javascript #webdevelopment #frontend #coding #developers #mern #learning
To view or add a comment, sign in
-
-
JS Pop Quiz: Did we just overwrite the Admin?! Let’s see who really understands JavaScript memory allocation! 👨💻👩💻 Look at the code snippet from @codewithsarir. We have a user1 object. We assign it to user2, and then change user2's role to 'Guest'. Question: What does console.log(user1.role) actually print? A) 'Admin' (Because we only changed user2) B) 'Guest' (Because they share the same reference) C) undefined D) It throws a TypeError Hint: Think about how JavaScript handles Objects versus Primitive types like strings. Does = make a copy, or just point to the same address? 🤔 Drop your guess in the comments before you test it in your IDE! 👇 Hashtags: #JavaScript #CodingQuiz #WebDesign #ProgrammerLife #Developers #LearnToCode #JS #Frontend #creators #codinglife #programmer
To view or add a comment, sign in
-
-
What To Know in JavaScript (2026 Edition). Part 3. RegExp Improvements. Working with user input in RegExp has always been risky — special characters could break your patterns. New improvements solve this with safe escaping. A small but critical improvement: - fewer bugs - safer handling of user input - easier dynamic regex creation #frontend #webdev #javascript #performance
To view or add a comment, sign in
-
-
🎡 JavaScript Event Loop — Quick Challenge Most developers get this wrong 👀 🧪 What will be the output of this code? (Check the image 👇) 👉 Drop your answer in the comments before scrolling. ⏳ Think first... . . . ✅ Answer 1. Start 4. End 3. Promise.then (Microtask) 2. setTimeout (Macrotask) 🔍 Simple Explanation JavaScript runs code in this order: 1️⃣ First → Normal (synchronous) code 2️⃣ Then → All Promises (Microtasks) 3️⃣ Finally → setTimeout (Macrotasks) 👉 Even if setTimeout is 0, it still runs later. 🧠 Takeaway Promise.then → runs sooner setTimeout → runs later Simple rule, but super useful in real projects. 💬 What was your answer? #JavaScript #EventLoop #Frontend #WebDevelopment #CodingTips
To view or add a comment, sign in
-
-
🚀 JavaScript Array Methods Cheat Sheet 🚀 Level up your JS game (especially in React!) with these essentials. Simple explanations + examples: • filter() 🔍: New array of matching items. numbers.filter(n => n > 5) → • map() ✨: Transform every item. names.map(name => name.toUpperCase()) → ["ALICE", "BOB"] • find() 🕵️: First match only. users.find(u => u.id === 1) • findIndex() 📍: Index of first match. • every() ✅: All true? scores.every(s => s > 60) → true/false • some() ➕: At least one true? • fill() 🧱: Fill with a value (mutates!). • concat() 🔗: Merge arrays safely. Pro Tip: Chain filter + map in React for clean lists! data.filter(item => item.active).map(item => <Item key={item.id} />) Master these = faster code + happier teams. 💪 #JavaScript #React #WebDev #CodingTips #Frontend #ArrayMethods #Developers #Programming #ReactJS #30DaysOfCode
To view or add a comment, sign in
-
-
💡 JavaScript Basics That Still Confuse Many Developers… Let’s break down a classic: Function Declaration vs Function Expression 👇 🔹 Function Declaration function greet() { console.log("Hello!"); } ✔ Hoisted (you can call it before it’s defined) ✔ Cleaner and easier to read 🔹 Function Expression const greet = function() { console.log("Hello!"); }; ✔ Not hoisted (must be defined before use) ✔ More flexible (can be anonymous, used in callbacks, etc.) 🚀 Key Difference: Function declarations are available throughout the scope, while function expressions behave like variables. 📌 Pro Tip: Prefer function expressions (especially arrow functions) in modern JavaScript for better control and predictability. #JavaScript #WebDevelopment #CodingBasics #Frontend #LearnToCode
To view or add a comment, sign in
-
-
"Why does JavaScript return "undefined" instead of throwing an error here?" 🤔 If you've ever faced this… you've already encountered Hoisting. Let’s understand it simply 👇 🔹 What is Hoisting? Hoisting means JavaScript moves declarations to the top of their scope before execution. But the behavior is different for "var", "let", and "const" 👇 🔹 var - Gets hoisted - Initialized with "undefined" Example: console.log(a); // 👉 undefined var a = 10; 🔹 let & const - Also hoisted - But NOT initialized This phase is called the Temporal Dead Zone (TDZ) Example: console.log(b); // ❌ ReferenceError let b = 10; 🔹 Function Hoisting Function declarations are fully hoisted ✅ Example: sayHello(); // ✅ works function sayHello() { console.log("Hello"); } 🚀 Pro Tip: Always declare variables before using them. It makes your code predictable and bug-free. 💬 Be honest — did hoisting confuse you at first? 😄 #javascript #webdevelopment #mern #coding #developers
To view or add a comment, sign in
-
🚀 Day 21 – Hoisting Explained (JavaScript) Ever logged a variable before declaring it and got undefined instead of an error? 🤔 That’s hoisting in action! 💡 JavaScript moves declarations to the top of their scope before execution — but there’s a catch… 🔹 var is hoisted (but only declared) 👉 Initialized as undefined 🔹 let & const are hoisted too… BUT ❌ They live in the Temporal Dead Zone (TDZ) 👉 Accessing them early throws an error 🔹 Functions behave differently ✅ Function declarations → fully hoisted ❌ Function expressions → NOT hoisted the same way ⚠️ Why this matters? Hoisting can silently introduce bugs if you’re not careful. 🔥 Pro Tip (Angular Devs): ✔ Prefer let & const ✔ Avoid relying on hoisting ✔ Write clean, predictable code 🧠 Once you understand hoisting, debugging weird undefined issues becomes MUCH easier! 💬 Have you ever been confused by hoisting? Drop your experience below 👇 #JavaScript #Angular #Frontend #WebDevelopment #100DaysOfCode
To view or add a comment, sign in
-
-
Just built the classic Snake Game using HTML, CSS, and JavaScript 🐍 The logic behind it was really interesting — especially handling movement, detecting collisions, and making the snake grow after eating food. This project helped me improve: • JavaScript logic building • DOM manipulation • Game loop concepts Still learning and exploring 🚀 Would love to hear your feedback! #JavaScript #WebDevelopment #Frontend #Projects #Learning
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