const object = {
property: 'Welcome JS world'
};
Object.freeze(object);
object.property = 'Welcome to object world';
console.log(Object.isFrozen(object)); // Welcome to object world
delete object.property; // You cannot delete when sealed
console.log(object.property); //Welcome to object world
Maybe:
const object = {
property: 'Welcome JS world'
};
Object.seal(object);
object.property = 'Welcome to object world';
console.log(Object.isSealed(object)); // true
delete object.property; // You cannot delete when sealed
console.log(object.property); //Welcome to object world
On this page: https://github.com/learning-zone/javascript-interview-questions We have a section called "Q. What is the purpose of exec method?" with code below:
Is it "exec" instead "test" ?
Q. What is the purpose of seal method? We have:
Maybe: