Javascript interview questions 2022

 Javascript interview questions 2022

Question : 1

What are the syntax rules of JSON?

Answer:

Below are the list of syntax rules of JSON:

Square brackets hold arrays

The data is in name/value pairs

The data is separated by commas

Curly braces hold objects



Question : 2

What is the role of break and continue statements?

Answer:

The break statement is used to come out of the current loop. In contrast, the continue statement continues the current loop with a new recurrence.

Question : 3

What is the purpose of the array slice method?

Answer:

The slice () method returns the selected elements in an array as a new array object. It selects the elements starting at the given start argument, and ends at the given optional end argument without including the last element If you omit the second argument then it selects till the end.


Question : 4

Why do you need web storage?

Answer:

Web storage is more secure, and 1arge amounts of data can be stored locally, without affecting website performance. Also, the information is never transferred to the server. Hence this is a more recommended approach than Cookies.


Question : 5

What is event bubbling in Javascript?

Answer:

Event bubbling is a type of event propagation where the event first triggers on the innermost target element, and then successively triggers on the ancestors parents) of the target element in the same nesting hierarchy till it reaches the outermost DOM element.


Tags:
 Learn Javascript
Javascript Interview questions 2022


















Post a Comment

0 Comments