Object.freeze() VS Object.seal() 👇 - In freeze, object's structure and values are totally locked. existing properties can't be changed or deleted. new properties can't be added. - In seal, only object's structure is locked. existing properties can be changed but not deleted. new properties can't be added. Important Points 👇 - Both freeze and seal are shallow which means they only affect the outer main object and not the nested objects. - The structure and properties of nested objects can still be changed. - To make seal or freeze deep, we have to apply it recursively on all nested objects through functions or loops. Hitesh Choudhary Piyush Garg Chai Aur Code Akash Kadlag Jay Kadlag #JavaScript #WebDevelopment #FrontendDevelopment #WebDev #Coding #Programming #Developer #LearnJavaScript #LearningInPublic #100DaysOfCode #TechCommunity #SoftwareDevelopment #ObjectOrientedProgramming #ChaiAurCode #ReactJS
Object Freeze vs Seal in JavaScript: Key Differences
More Relevant Posts
-
It's 5:45 am & I am still looking at my dreams. Today[2/28/2026] is day 23 of learning javascript Today & tommorow i will learn are: 1. Difference between let, const & var 2. How to use the default parameter 3. Template string, Multiline string, Dynamic string 4. Arrow Function Syntax, params 5. Spread Operator, Array Max, Copy Arrays 6. Object & Array destructuring 7. Keys, Values, Entries, Delete, Seal, Freeze 8. Accessing Object Data: Nested Object, Optional Chaining 9. Looping Object 10. Primitive Type, Non Primitive Type 11. Null Vs Undefines 12. Truthy & Falsy Values 13. ==, === , implicit conversion 14. Block Scope, Global Scope, Simple Unders. of Hoisting 15. Closure 16. Callback Function & pass different function 17. Function Arguments, pass by ref. pass by value 18. Map, ForEach 19. Filter, Find, Reduce #letsconnect #programmer #frontenddeveloper #mernstakedeveloper #Coding
To view or add a comment, sign in
-
15 minutes wasted… and it wasn’t even JavaScript’s fault. I was convinced something was wrong with map(). My array looked fine. But this kept printing in my console: [undefined, undefined, undefined] Here’s what I wrote: const doubled = numbers.map((num) => { num * 2; }); Turns out… I forgot one word: 𝗿𝗲𝘁𝘂𝗿𝗻 When you use { } in map(), you need an explicit 𝗿𝗲𝘁𝘂𝗿𝗻. That tiny detail cost me time. Now I always check one thing: Am I returning something or just running code? A small mistake, easy to miss, yet still humbling. What’s a JS bug that made you question your sanity? 👇 #JavaScript #FrontendDevelopment #WebDevelopment #CodingTips #JuniorDevelopers #LearnToCode #Programming #CodeDebugging #DeveloperLife #CleanCode
To view or add a comment, sign in
-
-
🚀 Understanding Memoization in JavaScript When working with functions that perform heavy calculations, running the same computation again and again can slow down your application. This is where Memoization becomes very useful. Memoization is an optimization technique where the result of a function is stored after it is executed for the first time. If the function is called again with the same input, the stored result is returned instead of recalculating it. This helps to: ✔️ Reduce unnecessary computations ✔️ Improve performance ✔️ Make applications faster and more efficient In this example, once a value is calculated, it is saved in the cache, so the function doesn’t need to compute it again. In simple terms, Memoization remembers previous results to make future operations faster. It’s commonly used in recursive algorithms, dynamic programming, and performance optimization in JavaScript applications. #JavaScript #WebDevelopment #FrontendDevelopment #Programming #Coding #SoftwareDevelopment #Developers #TechLearning #LearnJavaScript #PerformanceOptimization #CodingJourney #TechCommunity
To view or add a comment, sign in
-
-
Unpopular opinion: "Performance" is a feature, not an afterthought. Most devs wait until the site feels "heavy" to start optimizing. By then, your bounce rate has already spiked. I wanted to make the technical side of speed easier to digest, so I built a checklist with the exact benchmarks you should be hitting in 2026 Whether you're a junior dev or a senior architect, this should be in your bookmarks. 🔖 Link: https://lnkd.in/eq_Np6JJ #WebDesign #Programming #TechTips #JavaScript
To view or add a comment, sign in
-
-
So you wanna know lexical scoping? 👀 here is the easy way... But before that, you need to understand two small things. 1. Scope Scope just means where you can access a variable in your code. function greet() { let message = "Hello"; console.log(message); // works here } console.log(message); // error Here "message" only exists inside the function. 2. Lexical Lexical simply means where something is written in the code. JavaScript decides scope by how the code is structured, not where a function is called. For example: function outer() { let name = "sharat"; function inner() { console.log(name); } inner(); } "inner()" can access "name" because it was written inside "outer()". When JavaScript looks for a variable, it first checks the current scope, then moves to the outer scope, and keeps going until it reaches the global scope. That’s basically lexical scoping. all thanks to Sheryians Coding School and Devendra Dhote #javascript #webdevelopment #frontend #coding
To view or add a comment, sign in
-
-
JavaScript's array methods map, filter, and reduce are game changers for developers aiming to write clean, efficient, and maintainable code. These methods allow us to transform, select, and aggregate data in arrays with simple, expressive functions. Whether you're doubling numbers, filtering specific data points, or calculating sums, mastering these built-in functions can dramatically improve your code readability and performance. In my latest article, I share practical examples and best practices to help you unlock the full potential of these methods. How do you use map, filter, or reduce in your projects? Let's discuss strategies to leverage these tools for better coding outcomes. #javascript #webdevelopment #programming #codingtips #softwareengineering Check out the actual blog here : https://lnkd.in/gcGRNu2v
To view or add a comment, sign in
-
JavaScript doesn’t execute code randomly. Every time it runs, it creates an Execution Context ⚡ Understanding this concept makes hoisting and closures much easier to master. 🔹 Two Main Phases: 1️⃣ Memory Creation Phase • Variables are stored as undefined • Functions are stored completely in memory 2️⃣ Code Execution Phase • Code runs line by line • Values get assigned 🔹 Example: var a = 10; function greet() { console.log("Hello"); } 👉 Memory Phase: a → undefined greet → full function 👉 Execution Phase: a → 10 Once you understand Execution Context, debugging becomes much easier and JavaScript starts making logical sense instead of feeling “magical”. Connect with me on LinkedIn: https://lnkd.in/dx7fPEsy #JavaScript #ExecutionContext #FrontendDeveloper #WebDevelopment #Programming #Coding #Developers #TechContent #LearningInPublic 🚀
To view or add a comment, sign in
-
-
Check if a Binary String Contains Only One Segment of 1s Problem: Given a binary string s, determine whether the string contains only one contiguous segment of '1's. If we ever find a '1' that appears after a '0', it means a new segment of 1s has started — which violates the condition. Approach: -Iterate through the string. -Check if the previous character is '0' and the current character is '1'. -If that happens, it means there are multiple segments of 1s, so return false. 🔍 Time Complexity:O(n) 🔍 Space Complexity:O(1) #javascript #typescript #algorithms #datastructures #leetcode #codingpractice #frontenddeveloper #softwareengineering #problemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
📌 #67 DailyLeetCodeDose Today's problem: 61. Rotate List – 🟡 Medium Before rotating the list, we should determine its length. If the length is 3 and the number of rotations is 10, it's safe to say that we only need to perform one rotation instead of 10 to get the same result (10 % 3 === 1). The second important idea is that we can perform all the rotations at once — we just need to identify the new head and the new tail, connect the old tail to the head, and then break the list at the correct position. That's essentially what my code does. https://lnkd.in/eEnjh6ZF #DailyLeetCodeDose #LeetCode #JavaScript #Algorithms #ProblemSolving #Coding
To view or add a comment, sign in
-
-
🚀 Day 1 of JavaScript Pattern Practice! Today I practiced building a simple star pattern using JavaScript functions. Patterns are a great way to improve your logic and get comfortable with loops. Here's the code I wrote: // Function to print star pattern function printStars(rows) { for (let i = 1; i <= rows; i++) { console.log('*'.repeat(i)); } } // Call the function printStars(4); Output: * ** *** **** ⭐ Key Learnings: Using for loops to control rows Using string.repeat() to create repeated characters Functions help in reusing code easily Looking forward to learning more patterns in the coming days! 💻 #100DaysOfCode #JavaScript #Coding #FrontendDevelopment #Patterns #LearnToCode
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