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?

Filed under: JavaScript Interview Questions on 2022-08-06 09:35:56
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?

Filed under: JavaScript Interview Questions on 2022-08-06 09:35:08
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?

Filed under: JavaScript Interview Questions on 2022-08-06 09:33:31
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?

Filed under: JavaScript Interview Questions on 2022-08-05 07:33:58
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

Filed under: JavaScript Interview Questions on 2022-08-02 06:13:53
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?

Filed under: JavaScript Interview Questions on 2022-08-02 06:12:44
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 is NaN property in JavaScript?

Filed under: JavaScript Interview Questions on 2022-07-04 19:30:33
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

Filed under: JavaScript Interview Questions on 2022-07-03 07:56:47
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;