𝗗𝗮𝘆 𝟯 𝗼𝗳 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 🚀 Today I explored 𝗠𝗲𝗺𝗼𝗿𝘆 𝗠𝗮𝗻𝗮𝗴𝗲𝗺𝗲𝗻𝘁 𝗶𝗻 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁, and it was eye-opening! Here’s what I learned about how memory is organized: • 𝗦𝘁𝗮𝗰𝗸 – stores primitive values like numbers and strings, with fast access • 𝗛𝗲𝗮𝗽 – stores objects, arrays, and reference types, which are larger and more flexible • 𝗦𝗠𝗜 (Small Integers) – a clever optimization where JavaScript stores small numbers efficiently to save memory and improve performance Understanding these concepts gives me a deeper appreciation for how JavaScript works under the hood and helps me write cleaner, more efficient code. #JavaScript #WebDevelopment #100DaysOfCode #LearningJourney #FrontendDevelopment
Exploring JavaScript Memory Management in JavaScrip
More Relevant Posts
-
💡 𝗧𝗶𝗽 𝗼𝗳 𝘁𝗵𝗲 𝗗𝗮𝘆 — 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗗𝗶𝗱 𝘆𝗼𝘂 𝗸𝗻𝗼𝘄? "Object.freeze()" makes an object 𝗶𝗺𝗺𝘂𝘁𝗮𝗯𝗹𝗲 — but only at the top level. That means: - You 𝗰𝗮𝗻𝗻𝗼𝘁 𝗮𝗱𝗱, 𝗿𝗲𝗺𝗼𝘃𝗲, 𝗼𝗿 𝗰𝗵𝗮𝗻𝗴𝗲 properties on the frozen object - But 𝗻𝗲𝘀𝘁𝗲𝗱 𝗼𝗯𝗷𝗲𝗰𝘁𝘀 𝗰𝗮𝗻 𝘀𝘁𝗶𝗹𝗹 𝗯𝗲 𝗺𝗼𝗱𝗶𝗳𝗶𝗲𝗱 🔧 𝗜𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁: If you need full immutability, you’ll need a 𝗱𝗲𝗲𝗽 𝗳𝗿𝗲𝗲𝘇𝗲 (or use libraries like Immer). Shallow vs deep immutability — a small detail that can cause big bugs. #JavaScript #FrontendDevelopment #WebDevelopment #SoftwareEngineering #CodingTips #CleanCode #BestPractices #FullstackDeveloper
To view or add a comment, sign in
-
-
💻 JavaScript Intermediate – Remove Duplicates from an Array Duplicates in arrays can cause bugs or unnecessary processing. Here's a clean way to remove them. 📌 Problem: Get an array containing only unique values. JavaScript code function removeDuplicates(arr) { return [...new Set(arr)]; } console.log(removeDuplicates([1, 2, 2, 3])); 📤 Output: [1, 2, 3] 📖 Explanation: • Set automatically stores unique values only. • Spread operator ... converts it back to an array. 💡 Tip: Use this for data cleaning, API responses, or user inputs. #JavaScript #Coding #WebDevelopment #FrontendDevelopment #LearnToCode #ProgrammingTips
To view or add a comment, sign in
-
-
🚀 Day 924 of #1000DaysOfCode ✨ Sorting in JavaScript — Beyond Just `.sort()` Sorting looks simple at first — just call `.sort()` and you’re done, right? Not exactly. In today’s post, I’ve explained sorting in JavaScript in a clear and practical way. From how the default sorting works to how custom compare functions change behavior, everything is broken down so you can confidently sort numbers, strings, and even complex objects. If you’ve ever been surprised by unexpected sorting results, this post will help you understand why that happens. 👇 What’s the most complex data you’ve had to sort in JavaScript? #Day924 #learningoftheday #1000daysofcodingchallenge #FrontendDevelopment #WebDevelopment #JavaScript #React #Next #CodingCommunity
To view or add a comment, sign in
-
I practiced destructuring in JavaScript, and it’s a very useful feature. Using destructuring, we can easily extract values from arrays and objects. For arrays, we use square brackets []. For objects, we use curly braces {}. In arrays, values are assigned based on their position, and in objects, they are assigned based on property names. Such a clean and efficient way to work with data. #JavaScript #Destructuring #ES6 #WebDevelopment #LearningJourney
To view or add a comment, sign in
-
✨ 𝗗𝗮𝘆 𝟴 𝗼𝗳 𝗠𝘆 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 🚀 Today I explored 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗢𝗯𝗷𝗲𝗰𝘁𝘀 𝗮𝗻𝗱 𝘁𝗵𝗲𝗶𝗿 𝗠𝗲𝗺𝗼𝗿𝘆 𝗠𝗮𝗻𝗮𝗴𝗲𝗺𝗲𝗻𝘁 𝗶𝗻-𝗱𝗲𝗽𝘁𝗵, and learned how objects are actually structured behind the scenes in memory. I discovered that JavaScript objects are stored in the heap, and the variable holds a reference (pointer) in the stack. But what’s more interesting is that internally, objects have different pointers: • 𝗠𝗮𝗽 𝗣𝗼𝗶𝗻𝘁𝗲𝗿 → points to the object’s hidden class (structure and layout of properties) • 𝗣𝗿𝗼𝗽𝗲𝗿𝘁𝗶𝗲𝘀 𝗣𝗼𝗶𝗻𝘁𝗲𝗿 → points to where named properties are stored • 𝗘𝗹𝗲𝗺𝗲𝗻𝘁𝘀 𝗣𝗼𝗶𝗻𝘁𝗲𝗿 → points to indexed elements (used especially in arrays) This explains how JavaScript engines optimize objects for performance and access speed. Understanding these low-level details helps me see JavaScript beyond syntax — it’s helping me understand how things really work under the hood. Building strong fundamentals step by step. #JavaScript #100DaysOfCode #WebDevelopment #LearningJourney #FrontendDevelopment #ComputerScience
To view or add a comment, sign in
-
-
Practiced using map() in JavaScript today. Instead of manually looping through an array, map() creates a new transformed array. Cleaner logic. Better readability. Small improvements like this make code more maintainable. #JavaScript #ArrayMethods #WebDevelopment #FrontendDevelopment #CleanCode #LearningInPublic #CodingJourney #DeveloperLife #100DaysOfCode
To view or add a comment, sign in
-
-
🚀#Day45 #100Daysofcode – Introduction to Templating with EJS Today I started working with EJS (Embedded JavaScript) and understood how templating works in backend development. 🔹learned today: • What templating is and why it’s needed • How to use EJS with Express • Setting up the views directory • Understanding interpolation syntax: <%= %> for output <% %> for logic • Passing dynamic data from backend to EJS templates 💡Key Understanding: Instead of sending only JSON responses, the server can now render dynamic HTML pages using data. This helped me understand how backend and frontend connect in server-side rendering. #Day45complete✅👍🏻 #ExpressJS #NodeJS #BackendDevelopment #MERNStack #100DaysOfCode #WebDevelopment
To view or add a comment, sign in
-
-
✨ 𝗗𝗮𝘆 𝟭𝟳 𝗼𝗳 𝗠𝘆 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 🚀 Today I explored one of the most important concepts in JavaScript: the 𝗘𝘃𝗲𝗻𝘁 𝗟𝗼𝗼𝗽. I learned why 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗶𝘀 𝘀𝗶𝗻𝗴𝗹𝗲-𝘁𝗵𝗿𝗲𝗮𝗱𝗲𝗱 𝗮𝗻𝗱 𝘀𝘆𝗻𝗰𝗵𝗿𝗼𝗻𝗼𝘂𝘀, yet still capable of handling asynchronous tasks efficiently. Key ideas I understood: 🔹 𝗦𝗶𝗻𝗴𝗹𝗲-𝘁𝗵𝗿𝗲𝗮𝗱𝗲𝗱 𝗻𝗮𝘁𝘂𝗿𝗲 – JavaScript runs one task at a time on a single call stack. 🔹 𝗦𝘆𝗻𝗰𝗵𝗿𝗼𝗻𝗼𝘂𝘀 𝗲𝘅𝗲𝗰𝘂𝘁𝗶𝗼𝗻 – code runs line by line by default. 🔹 𝗘𝘃𝗲𝗻𝘁 𝗟𝗼𝗼𝗽 – manages asynchronous operations by coordinating the 𝗖𝗮𝗹𝗹 𝗦𝘁𝗮𝗰𝗸, 𝗪𝗲𝗯 𝗔𝗣𝗜𝘀, 𝗮𝗻𝗱 𝗖𝗮𝗹𝗹𝗯𝗮𝗰𝗸 𝗤𝘂𝗲𝘂𝗲. This concept finally helped me understand how JavaScript handles things like 𝘁𝗶𝗺𝗲𝗿𝘀, 𝗲𝘃𝗲𝗻𝘁𝘀, 𝗮𝗻𝗱 𝗮𝘀𝘆𝗻𝗰𝗵𝗿𝗼𝗻𝗼𝘂𝘀 𝗼𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻𝘀 without blocking the main thread. #JavaScript #100DaysOfCode #WebDevelopment #LearningJourney #FrontendDevelopment #EventLoop
To view or add a comment, sign in
-
-
Revisiting some important JavaScript Web API concepts today to strengthen my fundamentals. Here’s a quick summary of what I revised: • DOM APIs – manipulating elements using methods like querySelector() • Event Handling – handling user interactions with addEventListener() • Timer Functions – understanding setTimeout() and setInterval() • Network APIs – making requests using fetch() and XMLHttpRequest I also reviewed how the JavaScript Event Loop works behind the scenes: • How the Call Stack executes synchronous code first • How asynchronous tasks move to Microtask Queue (Promises) and Macrotask Queue (setTimeout, events, fetch) • Why Microtasks get higher priority than Macrotasks • How the Event Loop continuously checks the stack and queues to manage execution Understanding these concepts really helps in writing better asynchronous JavaScript and debugging real-world applications. Grateful to Devendra Dhote for the guidance and clear explanations during the learning process. #JavaScript #WebDevelopment #AsyncJavaScript #EventLoop #Promises #FrontendDevelopment #LearningInPublic #WebAPIs
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
Oh, great