You are here: Home / Topics / Search / JavaScript Interview Questions
Showing 20 Search Results for : JavaScript Interview Questions

What are the types of errors in javascript?

By Geetam on 06 Aug 22 | Filed under: JavaScript Interview Questions
There are two types of errors in javascript.Syntax error: Syntax errors are mistakes or spelling problems in the code that cause the program to not execute at all or to stop running halfway through. Error messages are usually supplied as well.Logical error: Reasoning mistakes occur when the syntax i  ......

What is DOM?

By Geetam on 06 Aug 22 | Filed under: JavaScript Interview Questions
DOM stands for Document Object Model.  DOM is a programming interface for HTML and XML documents.When the browser tries to render an HTML document, it creates an object based on the HTML document called DOM. Using this DOM, we can manipulate or change various elements inside the HTML document.

What do you mean by BOM in Javascript?

By Geetam on 06 Aug 22 | Filed under: JavaScript Interview Questions
Browser Object Model is known as BOM. It allows users to interact with the browser. A browser's initial object is a window. As a result, you may call all of the window's functions directly or by referencing the window. The document, history, screen, navigator, location, and other attributes are avai

What do mean by prototype design pattern?

By Shyam Dubey on 05 Aug 22 | Filed under: JavaScript Interview Questions
The Prototype Pattern produces different objects, but instead of returning uninitialized objects, it produces objects that have values replicated from a template – or sample – object. Also known as the Properties pattern, the Prototype pattern is used to create prototypes.The introduction of bus  ......

Explain WeakSet in javascript

By Ruchi Sharma on 02 Aug 22 | Filed under: JavaScript Interview Questions
In javascript, a Set is a collection of unique and ordered elements. Just like Set, WeakSet is also a collection of unique and ordered elements with some key differences:Weakset contains only objects and no other type.An object inside the weakset is referenced weakly. This means, that if the object   ......

Why do we use callbacks in Javascript?

By Ruchi Sharma on 02 Aug 22 | Filed under: JavaScript Interview Questions
A callback function is a method that is sent as an input to another function (now let us name this other function "thisFunction"), and it is performed inside the thisFunction after the function has completed execution.JavaScript is a scripting language that is based on events. Instead of waiting for  ......

What do you mean by strict mode in javascript and characteristics of javascript strict-mode?

By Deepak Sahoo on 04 Jul 22 | Filed under: JavaScript Interview Questions
In ECMAScript 5, a new feature called JavaScript Strict Mode allows you to write a code or a function in a "strict" operational environment. In most cases, this language is 'not particularly severe' when it comes to throwing errors. In 'Strict mode,' however, all forms of errors, including silent er  ......

What is NaN property in JavaScript?

By Deepak Sahoo on 04 Jul 22 | Filed under: JavaScript Interview Questions
NaN property represents the “Not-a-Number” value. It indicates a value that is not a legal number.typeof of NaN will return a Number.To check if a value is NaN, we use the isNaN() function,Note- isNaN() function converts the given value to a Number type, and then equates to NaN.isNaN("Hello") &n  ......

Explain Hoisting in javascript

By Monu Rathod on 03 Jul 22 | Filed under: JavaScript Interview Questions
Hoisting is the default behaviour of javascript where all the variable and function declarations are moved on top.This means that irrespective of where the variables and functions are declared, they are moved on top of the scope. The scope can be both local and global.Example 1:hoistedVariable = 3;
  ......