🚀 Learning Update: Stack Implementation in JavaScript Today I practiced building a Stack data structure from scratch using JavaScript! It follows the LIFO (Last In, First Out) principle — just like a stack of books 📚 The last element added is always the first one removed. Here’s a snippet of my implementation 👇 class Stack { constructor() { this.items = []; } push(value) { this.items.push(value); } pop() { if (this.items.length === 0) return undefined; return this.items.pop(); } peek() { return this.items[this.items.length - 1]; } } 🧠 What I learned: How push() and pop() work under the hood Why Stack is useful for undo operations, recursion, and function calls Practiced logical thinking and abstraction Next, I’m going to learn Queue — can’t wait to explore FIFO logic! 💻 #JavaScript #DataStructures #Stack #CodingJourney #WebDevelopment
Sondip kumar’s Post
More Relevant Posts
-
🚀 Learning Update: Queue in JavaScript Built a Queue from scratch today! 🖥️ Queue follows FIFO (First In, First Out) — like people waiting in line. Snippet: class Queue { constructor() { this.items = []; } enqueue(val) { this.items.push(val); } dequeue() { return this.items.length ? this.items.shift() : undefined; } peek() { return this.items[0]; } print() { console.log("start >", this.items.join(" > "), "> end"); } } const q = new Queue(); q.enqueue(10); q.enqueue(20); q.enqueue(30); q.print(); q.dequeue(); q.print(); console.log("Peek:", q.peek()); 💡 Key Takeaways: enqueue() & dequeue() in action Queue is great for task scheduling, async operations Practiced logic & abstraction Next up: Linked Lists 🔗 Can’t wait! #JavaScript #DataStructures #Queue #CodingJourney #WebDevelopment
To view or add a comment, sign in
-
🚀 Master JavaScript Arrays — From Basics to Advanced! Arrays are the backbone of data manipulation in JavaScript — from handling lists of items to building complex data structures. 📊 This guide covers everything you need to know — ✅ Creating, accessing, and modifying arrays ✅ Copying & cloning techniques (mutable vs. immutable) ✅ Modern methods like toReversed(), toSorted(), toSpliced(), and with() ✅ Deep dive into static & iterator methods (map, filter, reduce, find, flatMap, and more) ✅ Practical exercises and real-world challenges Whether you’re a beginner brushing up your fundamentals or an intermediate dev polishing your skills, this post is packed with examples and clear explanations to make Arrays second nature. 💪 📄 Download the full PDF below and start mastering one of the most powerful parts of JavaScript today. #JavaScript #FrontendDevelopment #WebDevelopment #Coding #Learning #Arrays #JSDeveloper
To view or add a comment, sign in
-
🚀 Master JavaScript Arrays — From Basics to Advanced! Arrays are the backbone of data manipulation in JavaScript — from handling lists of items to building complex data structures. 📊 This guide covers everything you need to know — ✅ Creating, accessing, and modifying arrays ✅ Copying & cloning techniques (mutable vs. immutable) ✅ Modern methods like toReversed(), toSorted(), toSpliced(), and with() ✅ Deep dive into static & iterator methods (map, filter, reduce, find, flatMap, and more) ✅ Practical exercises and real-world challenges Whether you’re a beginner brushing up your fundamentals or an intermediate dev polishing your skills, this post is packed with examples and clear explanations to make Arrays second nature. 💪 📄 Download the full PDF below and start mastering one of the most powerful parts of JavaScript today. #JavaScript #FrontendDevelopment #WebDevelopment #Coding #Learning #Arrays #JSDeveloper
To view or add a comment, sign in
-
100 Days of learning challenge : Day 19 Stop Using Arrays Wrong: We Just Unlocked the Map-Powered Secret to Eliminating Data Duplicates We've all faced it: arrays bloated with repeating data, leading to slow operations and messy code. This week, we realized that the core of robust, high-performance data management isn't just about what we store, but about guaranteeing uniqueness. Our deep dive into implementing a Custom Set Data Structure in JavaScript gave us the key to clean, mathematically sound data. The most powerful learning moment was understanding the brilliant architectural trick used to build a Set from the ground up. This shift in perspective showed us how to leverage existing tools for maximum efficiency: The Foundation: We leverage JavaScript’s highly optimized Map object as the internal storage mechanism (this.items = new Map()). This instantly gives us efficient key-based lookups, which is crucial for a Set. The Uniqueness Hack: The magic is in the add operation. To ensure no duplicates, we insert an element into the Map where the element itself acts as both the key and the value. Since a Map only allows unique keys, this elegantly enforces the Set's primary rule: one element, one entry. Performance is King: By utilizing the Map's constant-time O(1) average lookup speed (via the has() method), our custom Set can check for existing elements and prevent duplicates with incredible efficiency, dramatically outperforming array-based checks. Mastering a Set is about more than just adding elements; it’s about translating advanced set theory into actionable code. We successfully implemented the following foundational mathematical operations, which are essential for comparing and merging data collections: Union: Combining all unique elements from two sets into a new resultant set, eliminating any common duplicates automatically. Intersection: Finding only the elements that exist in both sets, providing us with their common ground—a critical operation for data analysis. The transition from theory to this practical, efficient implementation is a massive step forward for all of us. When we encounter data that must be unique, we now know to ditch the slow array methods and reach for the engineered power of the Set! #JavaScript #DataStructures #SetTheory #CodingTips #CleanCode #WebDevelopment #100DaysLearningChallenge The video that revealed the Set's internal secrets: https://lnkd.in/dFCCQsQP
Set Data Structure in JavaScript | Duplicate हटाओ Boss! | JS में Set का Magic Explained
https://www.youtube.com/
To view or add a comment, sign in
-
Leveling Up with Data Structures that Actually Matter! Over the last two days, I’ve been diving deep into Module 3: Data Structures That Actually Matter from the Next Level Web Development course by Programming Hero — and it’s been a total mindset shift! Here’s what I’ve learned so far 👇 🔹 Difference between Stateless and Stateful logic in JavaScript 🔹 Implementing Stack and Queue from scratch (and understanding their time complexity) 🔹 Building a Linked List — with append, prepend, insert, and remove operations 🔹 Practicing how real data moves and how we can optimize storage and performance Understanding how these structures work behind the scenes makes me appreciate how frameworks and libraries are built — and helps me write more efficient, scalable code. This is just the start, and I’m loving the process. Insha’Allah, I’ll keep learning, building, and sharing my progress along the way. 💪 Just ignore the image — it’s from the Medium website 😁 #NextLevelWebDevelopment #ProgrammingHero #WebDevelopment #JavaScript #DataStructures #LinkedList #Stack #Queue #LearningJourney #CareerGrowth #MERN
To view or add a comment, sign in
-
-
📸 Day 28: Mastering JavaScript Data Types 🧠💻 Today I explored one of the most fundamental parts of JavaScript — Data Types. 🔹 Primitive Types: Number | String | Boolean | null | undefined | NaN | Infinity | Symbol 🔹 Non-Primitive Types: Array | Object 💡 Key Insight: Primitives store simple, single values, while Non-Primitives hold references to complex data. This distinction changes how data behaves inside your programs! ⚡ Learning and leveling up every day with Sheryians Coding School Cohort 2.0 ✨ Big thanks to @harshvandanasharma, and @sheryians_coding_school 🙌 Which data type tripped you up the most when you started learning JS? 🤔👇 Connect with me: GitHub: github.com/octaveweb X: @KaranSwarnakar LinkedIn: https://lnkd.in/d8KfX8fS Facebook: https://lnkd.in/dh6C_9af #Day28 #JavaScript #DataTypes #Frontend #WebDev #CodingTips #Sheryians #LearningJourney #Cohort2
To view or add a comment, sign in
-
🚀 Day 42 of #100DaysOfWebDevelopment Challenge Today, I started learning one of the most important data structures in JavaScript — Arrays. Understanding arrays is essential for storing, managing, and manipulating multiple values efficiently. 🔹 Array Data Structure An array is a special type of object used to store ordered collections of data. Each element in an array has an index, starting from 0. Arrays can hold numbers, strings, objects, or even other arrays. 🔹 Visualizing Arrays I learned how arrays work internally — how elements are stored in sequence and can be accessed using their index positions. Example: arr[0] accesses the first element. 🔹 Mixed Arrays JavaScript allows mixed arrays, meaning an array can contain multiple data types at once (e.g., strings, numbers, booleans, or even functions). This flexibility makes it very versatile. 🔹 Mutability in Arrays Arrays in JavaScript are mutable, which means their elements can be changed even if the array itself is declared with const. Only the reference is constant, not the content. 🔹 Common Array Methods I also practiced some fundamental array methods: push() → adds an element at the end. pop() → removes the last element. shift() → removes the first element. unshift() → adds an element at the beginning. 💡 Key Takeaway: Arrays are the backbone of data manipulation in JavaScript. Learning how to manage and modify them effectively lays the groundwork for handling real-world data in applications. #100DaysOfCode #WebDevelopment #JavaScript #FrontendDevelopment #LearningInPublic #CodingJourney
To view or add a comment, sign in
-
-
🟦 Day 182 of #200DaysOfCode Today, I explored one of the most important concepts in JavaScript data handling — ✨ Deep Cloning a Nested Object Manually. In JavaScript, objects are stored by reference. So if you simply assign or shallow copy an object, any nested changes will still affect the original one. To truly create an independent copy, we need a deep clone — where every nested level is recreated. 🔍 What I built: A custom deepClone() function that: ✔ Loops through every key in the object ✔ Checks if a value is another object ✔ Uses recursion to clone deeply nested structures ✔ Returns a completely separate copy Why this matters? Deep cloning is essential when working with: • React state management • Redux reducers • Complex forms • API response manipulation • Saving snapshots of data without mutation 🧠 Key Takeaways: • Understanding reference vs value is crucial in JS • Recursion is a powerful tool for traversing deep structures • Manual deep cloning builds strong mental models of how objects behave • These fundamentals help you write safer, more predictable code This was one of those exercises where a simple concept reveals a deeper layer of how JavaScript actually works behind the scenes. Master the basics → scale effortlessly into advanced topics. #JavaScript #182DaysOfCode #LearnInPublic #DeepClone #Recursion #ProblemSolving #WebDevelopment #LogicBuilding #CodingChallenge #DeveloperMindset #ObjectsInJS
To view or add a comment, sign in
-
-
📅 Day 51 of #100DaysOfWebDevelopment This is part of the 100 Days of Web Development challenge, guided by mentor Muhammad Raheel at ZACoders. 🎯 Mastering Regular Expressions (Regex) in JavaScript 🧠 Today, I explored one of the most powerful tools in JavaScript — Regular Expressions (Regex). Regex allows us to search, match, and manipulate text patterns efficiently, making it an essential skill for form validation, data filtering, and text processing. ✅ What I Practiced Today: 🔹 Created different input fields to test Regex patterns in real time. 🔹 Used expressions to validate email addresses, numbers, letters, and special characters. 🔹 Practiced using RegExp methods like .test(), .match(), and .replace(). 🔹 Learned how to combine character classes, quantifiers, and anchors to form precise patterns. 🔹 Explored how Regex works with flags like g (global), i (case-insensitive), and m (multiline). ✨ Key Takeaways: 💡 Regex helps identify complex text patterns with minimal code. 💡 Validation becomes easier and more efficient using Regex. 💡 Common use cases include form validation, search filters, and input sanitization. 💡 Mastering Regex enhances both frontend and backend development skills. 📂 Please visit my GitHub to check the practice code I worked on today: 👉 GitHub - https://lnkd.in/eME6fwyV #100DaysOfCode #JavaScript #WebDevelopment #FrontendDevelopment #Regex #RegularExpressions #CodingJourney #ZACoders #Day51 #FormValidation
To view or add a comment, sign in
-
🔁 Exploring JavaScript Loops & Data Structures 🚀 Continuing my JavaScript journey, I moved ahead to one of the most essential concepts — Loops and Data Structures. Loops helped me understand how repetitive tasks can be automated efficiently. Learning how to use for, while, and forEach loops gave me clarity on how logic flows and how powerful iteration can be for problem-solving. I even built small projects to strengthen this understanding — each helping me think more logically and write cleaner, optimized code. Then came Data Structures, where I focused mainly on Arrays and Objects — the most commonly used structures in JavaScript. I explored: 🔹 Creating and updating objects 🔹 Working with arrays of objects 🔹 Common Array Methods like map(), filter(), reduce(), and find() 🔹 Array transformation techniques to handle data dynamically This part of learning made me realize how important it is to structure and manipulate data efficiently — something that forms the foundation of every modern web application. #JavaScript #WebDevelopment #CodingJourney #FrontendDevelopment #LearningJourney #MERNStack
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