🚀 Day 14/100 – Arrays in JavaScript = Small Methods, Big Power! Today I went back to basics and realized something powerful 👇 👉 Mastering array methods = writing cleaner, smarter code. Here’s a quick breakdown of what I revised 👇 💡 Transform & Create split() → turns a string into an array "hello world".split(" ") // ["hello", "world"] 💡 Add Elements push() → add at the end unshift() → add at the beginning let arr = [2,3]; arr.push(4); // [2,3,4] arr.unshift(1); // [1,2,3,4] 💡 Remove Elements pop() → removes last element arr.pop(); // [1,2,3] 💡 Find & Check indexOf() → find position [10,20,30].indexOf(20) // 1 💡 Rearrange reverse() → flips the array [1,2,3].reverse() // [3,2,1] 💡 Convert toString() → array → string join() → array → custom string [1,2,3].join("-") // "1-2-3" ✨ Big Realization: These aren’t just “methods”… they’re tools to think better in code. The more I practice, the more patterns I start seeing 🔁 📈 Consistency > Intensity Day by day, getting sharper. #100DaysOfCode #JavaScript #CodingJourney #LearnInPublic #WebDevelopment #LearningInPublic Sheryians Coding School Sheryians Coding School Community
Prabuddha Narayan Datta’s Post
More Relevant Posts
-
🚀 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 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
To view or add a comment, sign in
-
-
🔥 Day 13/100 — Mastering JavaScript Essentials 🚀 Today I revisited 3 absolute game-changers in JavaScript: map, filter, and reduce — the holy trinity of clean, functional code 💡 Here’s a quick breakdown 👇 ✨ map() — Transform Data Used when you want to modify every element in an array. 👉 Example: const nums = [1, 2, 3]; const squared = nums.map(n => n * n); // [1, 4, 9] 🧹 filter() — Select Data Used to keep only elements that match a condition. 👉 Example: const nums = [1, 2, 3, 4]; const evens = nums.filter(n => n % 2 === 0); // [2, 4] 🧠 reduce() — Aggregate Data Used to boil down an array into a single value. 👉 Example: const nums = [1, 2, 3, 4]; const sum = nums.reduce((acc, n) => acc + n, 0); // 10 💥 The real power? Combining them: const result = [1,2,3,4,5] .filter(n => n % 2 !== 0) .map(n => n * 2) .reduce((acc, n) => acc + n, 0); // Output: 18 ⚡ Cleaner code ⚡ Less loops ⚡ More readability It’s crazy how mastering these small concepts can level up your coding style BIG TIME 🚀 #100DaysOfCode #JavaScript #WebDevelopment #CodingJourney #Developers #LearnInPublic #Tech #Programming #LearningInPublic Sheryians Coding School Sheryians Coding School Community
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
-
-
I stopped chasing correct answers in JavaScript today… and started chasing why I was wrong. 👇 --- 💥 Mistakes that taught me more than tutorials: ❌ Thought "onclick" supports multiple handlers 👉 It overrides—use "addEventListener" instead ❌ Confused arrow function "this" 👉 Arrow functions don’t have their own "this" ❌ Expected "var" to behave like "let" 👉 Faced hoisting and scope differences ❌ Assumed async code runs in order 👉 Learned: microtasks run before macrotasks ❌ Misunderstood "await" 👉 It pauses execution and resumes via the microtask queue ❌ Ignored shallow copy behavior 👉 Spread operator copies references, not nested objects --- 💡 Big shift: I wasn’t stuck because JavaScript is hard… I was stuck because I wasn’t questioning why. --- 🎯 What changed: ✔ I analyze outputs instead of guessing ✔ I understand how JS behaves under the hood ✔ I debug with clarity, not confusion --- 📌 Lesson: Mistakes in coding aren’t failures. They’re proof that your understanding is evolving. --- 🚀 Next focus: Closures + real-world problem solving --- If you're learning JavaScript: 👉 Which concept confused you the most? 👉 And what finally made it click? Let’s learn together 👇 #JavaScript #LearningInPublic #Frontend #CodingJourney #Debugging
To view or add a comment, sign in
-
🚀 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
-
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
-
🚀 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
-
-
🚀 Understanding var, let, and const in JavaScript While learning JavaScript, one of the most important concepts I revisited is the difference between var, let, and const. It may look basic, but it plays a huge role in writing clean and bug-free code. 🔹 var - Function scoped - Can be re-declared and re-assigned - Can cause unexpected bugs due to scope leakage 🔹 let - Block scoped - Cannot be re-declared - Can be re-assigned 🔹 const - Block scoped - Cannot be re-declared or re-assigned - Must be initialized at the time of declaration 💡 One key takeaway: Use const by default, let when values need to change, and avoid var in modern JavaScript. Small concepts like these build a strong foundation for writing better and more predictable code. #JavaScript #WebDevelopment #Frontend #Coding #Learning #MERNStack #100DaysOfCode
To view or add a comment, sign in
-
-
Just published a new blog on Array Flattening in JavaScript 🚀 At first glance, it feels like a small concept… but once you go deeper, it touches recursion, problem-solving, and even interview-level thinking. In this blog, I covered: • What nested arrays actually are (with clear visuals) • Step-by-step thinking behind flattening • Different approaches (flat(), recursion, reduce, iterative) • Common interview scenarios and edge cases If you're learning JavaScript or preparing for interviews, this will be useful 👇 https://lnkd.in/gQgjYv54 #JavaScript #WebDevelopment #FrontendDevelopment #Coding #LearnInPublic #100DaysOfCode #Programming #SoftwareDevelopment
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