wip: add more questions

chore/javascript
Arik Chakma 1 year ago
parent 96fe0a5439
commit e9651c6afe
  1. 12
      src/data/question-groups/javascript/content/immutable-object.md
  2. 5
      src/data/question-groups/javascript/javascript.md

@ -0,0 +1,12 @@
To make an object immutable, you can use `Object.freeze()` method. It prevents the modification of existing property values and prevents the addition of new properties.
```js
const roadmap = {
name: 'JavaScript',
};
Object.freeze(roadmap);
roadmap.name = 'JavaScript Roadmap'; // throws an error in strict mode
console.log(roadmap.name); // JavaScript
```

@ -206,4 +206,9 @@ questions:
topics:
- 'Core'
- 'Advanced'
- question: How to make an Object immutable in JavaScript?
answer: immutable-object.md
topics:
- 'Core'
- 'Advanced'
---

Loading…
Cancel
Save