Skip to main content



Javascript interview questions set 2

For set 1 please refer to the Javascript interview question set 1.Let's begin with set 2,
3)What is the difference between Object.seal() and Object.freeze() in JavaScript? Object.seal() method protects the deletion of an existing property  but it can't protect the existing properties from outside changes.
 var object1 = {       prop1: 1   };
  Object.seal(object1);   object1.prop1 = 2; // value got changed   delete object1.prop1;   console.log(object1)   //It will show value of prop1=2.    We can't delete the property. It can just be modified.

In addition to the functionalities of Object.seal(), The Object.freeze() method even won't allow minute changes to the existing properties of an object.
 var object1 = {       prop1: 1   };
 Object.freeze(object1);  object1.prop1 = 2;   delete object1.prop1;  console.log(object1)  It will show the value of prop1=1.   We can't delete any property or modify any property.

4)What is negative infinity? The negative infinity in JavaScript is a constant val…

Latest Posts

Coding Interview Questions Set 3

Css Interview Questions Set 1

Coding Interview Questions Set 2

Coding Interview Questions Set 1

Node.js: Downloading a xml file from given url and reading its data elements.

2 JavaScript Interview Questions that you must know.

4 html interview questions that you must know.

Javascript/Node.js: 2 Features that you might not know.

Node.js: Bundling your Node.js application to single executable for Windows.

Node.js: Extract text from image using Tesseract.