<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/LgWkNSswG" -->

---
title: JavaScript object immutability: Object.freeze vs....
description: Immutability in JavaScript means that further changes to an object will not apply. This is, to an extent, what the const keyword achieves: it creates a...
canonical: https://daily.dev/posts/javascript-object-immutability-object-freeze-vs-object-seal-lgwknsswg
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: JavaScript object immutability: Object.freeze vs. Object.seal | daily.dev
og:description: Immutability in JavaScript means that further changes to an object will not apply. This is, to an extent, what the const keyword achieves: it creates a...
og:url: https://daily.dev/posts/javascript-object-immutability-object-freeze-vs-object-seal-lgwknsswg
og:image: https://api.daily.dev/og/posts/LgWkNSswG.png
og:image:alt: JavaScript object immutability: Object.freeze vs. Object.seal
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript object immutability: Object.freeze vs. Object.seal

**[LogRocket](https://daily.dev/sources/logrocket)** · 11 min read · 9 upvotes · 0 comments

## Summary

Immutability in JavaScript means that further changes to an object will not apply. This is, to an extent, what the const keyword achieves: it creates a reference to a value. JavaScript provides three methods that perform varying levels of restriction to objects. These include Objectfree() and Objectsealse() and the freeze() and seal() methods.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.logrocket.com/javascript-object-immutability-object-freeze-vs-object-seal/>

---

Tags: [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/javascript-object-immutability-object-freeze-vs-object-seal-lgwknsswg)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"JavaScript object immutability: Object.freeze vs. Object.seal","url":"https://daily.dev/posts/javascript-object-immutability-object-freeze-vs-object-seal-lgwknsswg","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/javascript-object-immutability-object-freeze-vs-object-seal-lgwknsswg"},"datePublished":"2021-09-17T13:07:32.466Z","dateModified":"2021-10-07T14:17:10.317Z","description":"Immutability in JavaScript means that further changes to an object will not apply. This is, to an extent, what the const keyword achieves: it creates a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/70520535e08681d00c47dc5e30b512af","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/70520535e08681d00c47dc5e30b512af","isAccessibleForFree":true,"articleSection":"LogRocket","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"LogRocket","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/logrocket","url":"https://daily.dev/sources/logrocket"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/javascript-object-immutability-object-freeze-vs-object-seal-lgwknsswg","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":9},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"LogRocket","item":"https://daily.dev/sources/logrocket"},{"@type":"ListItem","position":3,"name":"JavaScript object immutability: Object.freeze vs. Object.seal"}]}
```

