🚀 Day 15 of #100DaysOfCode Today was all about mastering two powerful JavaScript concepts that make code cleaner, smarter, and more expressive: 👉 Array Destructuring 👉 Spread Operator 💡 1. Array Destructuring No more messy indexing! You can unpack values from arrays in a clean way: const arr = [10, 20, 30]; const [a, b, c] = arr; console.log(a, b, c); // 10 20 30 You can even skip values or set defaults: const [x, , z = 50] = [5, 15]; console.log(x, z); // 5 50 ⚡ Cleaner code = better readability. 💡 2. Spread Operator (...) This tiny syntax unlocks big power 💥 👉 Copy arrays: const arr1 = [1, 2, 3]; const arr2 = [...arr1]; 👉 Merge arrays: const a = [1, 2]; const b = [3, 4]; const merged = [...a, ...b]; 👉 Add elements easily: const nums = [1, 2, 3]; const updated = [...nums, 4]; 🔥 No loops. No push chaos. Just elegance. ✨ Key Takeaway: Destructuring simplifies access. Spread operator simplifies manipulation. Together? They make your JavaScript feel like magic 🪄 📈 Consistency is the real superpower. Showing up every day. Learning every day. #JavaScript #WebDevelopment #CodingJourney #100DaysOfCode #LearnInPublic #Developers #LearningInPublic Sheryians Coding School Sheryians Coding School Community
Prabuddha Narayan Datta’s Post
More Relevant Posts
-
🚀 Building Strong Foundations in JavaScript 💻✨ ✨Continuing my journey of improving core JavaScript skills through hands-on coding 👇 🔹 Loops Practice ✅ Printed numbers from 1–50 using: • for loop • while loop • do...while loop 🔹 Logic Building ✅ Generated multiplication table dynamically using user input 🔹 Iteration Techniques ✅ Used for...of for arrays and for...in for objects 🔹 Functions Practice ✅ Built a function to check Prime or Non-Prime numbers ✅ Implemented a Callback Function to calculate square of a number ✅ Practiced IIFE (Immediately Invoked Function Expression) to print today’s date 💡 Key Learnings: • Better understanding of loops and iteration • Clear idea of callback & higher-order functions • Debugged a real issue with IIFE and semicolons 😄 📌 Step by step, improving logic and confidence in JavaScript! #JavaScript #CodingJourney #LearningByDoing #FrontendDeveloper #WebDevelopment #KeepGrowing 🚀
To view or add a comment, sign in
-
🚀 Day 36 of My Full Stack Development Journey Today I explored one of the most important concepts in JavaScript — Functions & Scope ⚡ Here’s what I learned today: 🔹 Functions – Reusable blocks of code 🔹 Functions with Arguments – Passing data into functions 🔹 Return Keyword – Getting values back from functions 🔹 Scope – Understanding where variables can be accessed 🔹 Global Scope, Function Scope, Block Scope 🔹 Lexical Scope – How functions access variables from parent scope 🔹 Solved 6 practice questions + 6 assignment questions 💻 These concepts helped me understand how to write cleaner, reusable, and more structured code. Step by step, building strong programming fundamentals 🚀 #FullStackJourney #WebDevelopment #JavaScript #LearningInPublic #100DaysOfCode #CodingJourney
To view or add a comment, sign in
-
🚀 Day 7 / 30 - JavaScript Coding Practice Today’s challenge: Recreating the Array.map() functionality — without actually using it 👀 Problem: Apply a transformation function to each element of an array and return a new array. 💡 Key Insight: This problem helped me understand what’s happening under the hood of built-in methods like map(). 👉 Instead of relying on .map(), I used a loop to: Iterate through each element Apply the given function with both value & index Build a new transformed array Solution: var map = function (arr, fn) { let transArr = [] arr.forEach((element, i) => { transArr.push(fn(element, i) ?? element); }); return transArr; }; #JavaScript #DSA #CodingPractice #100DaysOfCode #FrontendDevelopment #ProblemSolving
To view or add a comment, sign in
-
-
🚀 JavaScript Essentials — closures, Math operators & recursion, but make it real Step by step, I’m building stronger JavaScript fundamentals through practice. In this homework, I worked on topics that are simple in theory, but much more interesting when you actually implement them yourself: ● Closures & state management ● Recursive functions ● Math methods and function binding with apply() / bind() 🛠 What I built in practice: ● counter() — a closure-based counter that remembers its state and can restart from any given number ● counterFactory() — a small counter object with .value(), .increment(), and .decrement() built with closures ● myPow(a, b, myPrint) — a recursive power function with a callback for formatted output ● myMax(arr) — finding the maximum value in an array using Math.max.apply() ● myMul(a, b) + myDouble() / myTriple() — reusing logic with bind() This task helped me better understand how JavaScript works with scope, closures, recursion, and reusable functional patterns. What I like about this kind of practice is that it turns abstract concepts into something tangible. Not just “I read it” — but “I built it, tested it, and now I actually get it.” 🔗 GitHub: https://lnkd.in/dHTBr-h3 Always learning. Always building. One function at a time 💻 "Coding like Zagreus: dying, retrying, and somehow making progress. ⚔️💻" #JavaScript #LearningByDoing #Closures #Recursion #MathOperators #FunctionalProgramming #Frontend #CodingJourney #WebDevelopment
To view or add a comment, sign in
-
-
🚀 Day 13 of My JavaScript Learning Journey Today I learned about Looping Through Arrays in JavaScript and different ways to iterate over data efficiently. 📌 Key concepts I explored: 🔹 Manual Iteration • for...in → Iterates over indexes • for...of → Iterates over values directly 💡 Best Practice: Avoid using for...in for arrays. Prefer for...of for better readability and reliability. 🔹 Functional Iteration • forEach() → Executes a function for each element • Clean and modern way to write iteration logic Example: arr.forEach((value, index) => { console.log(value, index); }); 🔹 Quick Comparison • for...in → Returns index • for...of → Returns value • forEach() → Uses function (modern approach) 💡 Understanding iteration helps in writing clean, efficient, and readable code, especially when working with large datasets. Step by step, I’m improving my JavaScript fundamentals and coding logic. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
Understanding the Event Loop in JavaScript is a turning point for every developer. Many developers use async features like promises, setTimeout, or async/await daily — but very few truly understand what happens behind the scenes. I’ve written a detailed yet easy-to-understand article that breaks down: ✔ Call Stack ✔ Callback Queue ✔ Microtask Queue ✔ Execution Order If you want to strengthen your JavaScript fundamentals and avoid common async mistakes, this will definitely help. 👉 Read the full article: https://lnkd.in/gDhwvmUc I’d love to hear your thoughts — what was the hardest concept for you when learning the Event Loop? #JavaScript #SoftwareDevelopment #WebDevelopment #FrontendDevelopment #AsyncProgramming #Coding #TechLearning
To view or add a comment, sign in
-
🔥 Master the art of coding loops in JavaScript! 🚀 Loops are a fundamental concept in programming that allow you to execute a block of code multiple times. They are essential for automating repetitive tasks and iterating over data structures. For developers, understanding loops is crucial for writing efficient and concise code. Whether you're working on data manipulation, user interfaces, or backend logic, loops help you process large amounts of data with ease. Here's a step-by-step breakdown: 1️⃣ Initialize a counter variable 2️⃣ Set the condition for the loop to continue 3️⃣ Execute the code block inside the loop 4️⃣ Update the counter variable at the end of each iteration Check out the code example below: ``` for (let i = 0; i < 5; i++) { console.log('Hello, loop ' + i); } ``` Pro Tip: Use caution with infinite loops! Always ensure your loop has a clear exit condition to avoid crashing your program. Common Mistake Alert: Forgetting to update the counter variable in a loop can lead to infinite loops. Always remember to increment or decrement the counter inside the loop. 🌟 Question for you: What creative project are you currently working on with loops in your code? Share below! 💡 🌐 View my full portfolio and more dev resources at tharindunipun.lk #JavaScript #CodingLoops #ProgrammingBasics #DevTips #LoopMastery #CodeNewbie #TechTalk #DeveloperCommunity #DigitalSkills
To view or add a comment, sign in
-
-
🚀 Day 4 of my JavaScript Coding Practice Today’s problem: Two Sum var twoSum = function(nums, target) { const map = new Map(); // Store: { value : index } for (let i = 0; i < nums.length; i++) { const complement = target - nums[i]; // If the needed number is already in our map, we found the pair! if (map.has(complement)) { return [map.get(complement), i]; } // Otherwise, save the current number and its index map.set(nums[i], i); } return []; // Return empty if no pair is found }; 💡 Instead of using brute force (O(n²)), I used a HashMap approach to solve it in O(n) time. Key takeaway: Understanding how to trade space for time can significantly optimize performance. Small steps every day → Big improvements over time 📈 #JavaScript #DSA #CodingPractice #100DaysOfCode #FrontendDevelopment
To view or add a comment, sign in
-
-
Day 21 of My Learning Journey revisiting JavaScript fundamentals — Mutable vs Immutable Today’s tiny concept… but honestly, it explains *so many bugs* I’ve seen. --- It started with a simple question: “Why did my data change… when I didn’t touch it?” Answer: *Because it was mutable.* --- Mutable (can be changed) const arr = [1, 2, 3]; arr.push(4); console.log(arr); // [1, 2, 3, 4] Same array, modified in place. Other examples: * `push()`, `pop()`, `splice()` * Direct object updates const user = { name: "Vijaya" }; user.name = "Sri"; --- Immutable (cannot be changed — create new instead) const arr = [1, 2, 3]; const newArr = [...arr, 4]; console.log(arr); // [1, 2, 3] console.log(newArr); // [1, 2, 3, 4] For objects: const user = { name: "Vijaya" }; const updatedUser = { ...user, name: "Sri" }; ### The Subtle Bug Zone const state = { items: [1, 2] }; const newState = state; newState.items.push(3); console.log(state.items); // [1, 2, 3] 😬 You thought you created something new… but you actually mutated the original. ### Why This Matters * Predictable code 🧠 * Easier debugging 🐛 * Plays well with frameworks (React especially ⚛️) * Avoids side effects (the silent killers) ### 🪄 My Rule of Thumb 👉 If you're “updating” data… create a new version instead of modifying the old one. Funny how this one concept sits quietly… but controls the behavior of your entire application. #Day21 #JavaScript #Immutability #CodingJourney #CleanCode #100DaysOfCode #LearnInPublic #ContinueousLearner #LearningNeverStops #WebDevelopment #FrontendDeveloper
To view or add a comment, sign in
-
🚀 Just completed Sprint 03 — "Half Marathon Full Stack" — diving deep into Object-Oriented Programming in JavaScript at Innovation Campus of NTU "KhPI"! This sprint was all about shifting from writing scattered functions to thinking in objects, classes, and systems. OOP is a complete mindset change, and this sprint made that very clear. What we built: 🏗️ Hard Worker — a class with validated properties using getters and setters, enforcing strict age and salary ranges 🏢 Tower — practicing inheritance by extending a Building class with new properties and overriding toString() 🏠 Prototype — building house objects using JavaScript prototypes and constructor functions 🔤 Prototype function — extending the native String prototype with a custom removeDuplicates() method 📦 Collections — working with Set, Map, WeakSet, and WeakMap to model real-world data structures like guest lists and bank vaults 📁 Export classes — converting a class into a reusable JS module using export/import 🛡️ Hidden Proxy — using the Proxy object to intercept and validate property access and assignment ⏱️ Timer — building a timer class with setInterval and prototype methods for start, tick, and stop 🧩 Mixin — applying a mixin to extend a house object with text manipulation methods including ROT13 encryption 🔢 Step generator — implementing a generator function with function* and yield 🔗 Linked List — building a full LinkedList class from scratch with a custom [Symbol.iterator] 🦸 Upgrade Human — creating Human and Superhero classes with DOM integration, timers, and dynamic UI rendering Key lessons learned: The most eye-opening moment was understanding the difference between prototype-based and class-based inheritance in JavaScript — they are two sides of the same coin. Mixins solved the multiple inheritance problem elegantly. And implementing Symbol.iterator on the LinkedList made the data structure feel truly native to the language. The most challenging task was the Linked List — getting traversal, iteration, and the custom iterator right required solid understanding of how JavaScript handles object references and the iterator protocol. This sprint built the foundation that every modern JavaScript framework rests on. Ready for what comes next! 💪 #InnovationCampusKhPI #JavaScript #OOP #ObjectOrientedProgramming #FullStack #Sprint03 #WebDevelopment
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