Advertise here

JavaScript Interview Questions & Answers

June 16, 2020     1254    
JavaScript Interview Questions & Answers

List of 400+ JavaScript interview questions and answers.

1What are the possible ways to create objects in JavaScript?
2What is prototype chain?
3What is the difference between Call, Apply and Bind?
4What is JSON and its common operations
5What is the purpose of array slice method?
6What is the purpose of array splice method?
7What is the difference between slice and splice?
8How do you compare Object and Map?
9What is the difference between == and === operators?
10What are lambda or arrow functions?
11What is a first class function?
12What is a first order function?
13What is a higher order function?
14What is a unary function?
15What is currying function?
16What is a pure function?
17What is the purpose of let keyword?
18What is the difference between let and var?
19What is the reason to choose the name let as keyword?
20How do you redeclare variables in switch block without an error?
21What is Temporal Dead Zone?
22What is IIFE(Immediately Invoked Function Expression)?
23What is the benefit of using modules?
24What is memoization?
25What is Hoisting?
26What are classes in ES6?
27What are closures?
28What are modules?
29Why do you need modules?
30What is scope in javascript?
31What is a service worker?
32How do you manipulate DOM using service worker?
33How do you reuse information across service worker restarts?
34What is IndexedDB?
35What is web storage?
36What is a post message?
37What is a cookie?
38Why do you need a Cookie?
39What are the options in a cookie?
40How do you delete a cookie?
41What are the differences between cookie, local storage and session storage?
42What is the main difference between localStorage and sessionStorage?
43How do you access web storage?
44What are the methods available on session storage?
45What is a storage event and its event handler?
46Why do you need web storage?
47How do you check web storage browser support?
48How do you check web workers browser support?
49Give an example of web worker?
50What are the restrictions of web workers on DOM?
51What is a promise?
52Why do you need a promise?
53What are the three states of promise?
54What is a callback function?
55Why do we need callbacks?
56What is a callback hell?
57What is server-sent events?
58How do you receive server-sent event notifications?
59How do you check browser support for server-sent events?
60What are the events available for server sent events?
61What are the main rules of promise?
62What is callback in callback?
63What is promise chaining?
64What is promise.all
65What is the purpose of race method in promise?
66What is a strict mode in javascript?
67Why do you need strict mode?
68How do you declare strict mode?
69What is the purpose of double exclamation?
70What is the purpose of delete operator?
71What is typeof operator?
72What is undefined property?
73What is null value?
74What is the difference between null and undefined?
75What is eval?
76What is the difference between window and document?
77How do you access history in javascript?
78What are the javascript data types?
79What is isNaN?
80What are the differences between undeclared and undefined variables?
81What are global variables?
82What are the problems with global variables?
83What is NaN property?
84What is the purpose of isFinite function?
85What is an event flow?
86What is event bubbling?
87What is event capturing?
88How do you submit a form using JavaScript?
89How do you find operating system details?
90What is the difference between document load and DOMContentLoaded events?
91What is the difference between native, host and user objects?
92What are the tools or techniques used for debugging JavaScript code?
93What are the pros and cons of promises over callbacks?
94What is the difference between an attribute and a property?
95What is same-origin policy?
96What is the purpose of void 0?
97Is JavaScript a compiled or interpreted language?
98Is JavaScript a case-sensitive language?
99Is there any relation between Java and JavaScript?
100What are events?
101Who created javascript?
102What is the use of preventDefault method?
103What is the use of stopPropagation method?
104What are the steps involved in return false?
105What is BOM?
106What is the use of setTimeout?
107What is the use of setInterval?
108Why is JavaScript treated as Single threaded?
109What is an event delegation?
110What is ECMAScript?
111What is JSON?
112What are the syntax rules of JSON?
113What is the purpose JSON stringify?
114How do you parse JSON string?
115Why do you need JSON?
116What are PWAs?
117What is the purpose of clearTimeout method?
118What is the purpose of clearInterval method?
119How do you redirect new page in javascript?
120How do you check whether a string contains a substring?
121How do you validate an email in javascript?
122How do you get the current url with javascript?
123What are the various url properties of location object?
124How do get query string values in javascript?
125How do you check if a key exists in an object?
126How do you loop through or enumerate javascript object?
127How do you test for an empty object?
128What is an arguments object?
129How do you make first letter of the string in an uppercase?
130What are the pros and cons of for loop?
131How do you display the current date in javascript?
132How do you compare two date objects?
133How do you check if a string starts with another string?
134How do you trim a string in javascript?
135How do you add a key value pair in javascript?
136Is the '!--' notation represents a special operator?
137How do you assign default values to variables?
138How do you define multiline strings?
139What is an app shell model?
140Can we define properties for functions?
141What is the way to find the number of parameters expected by a function?
142What is a polyfill?
143What are break and continue statements?
144What are js labels?
145What are the benefits of keeping declarations at the top?
146What are the benefits of initializing variables?
147What are the recommendations to create new object?
148How do you define JSON arrays?
149How do you generate random integers?
150Can you write a random integers function to print integers with in a range?
151What is tree shaking?
152What is the need of tree shaking?
153Is it recommended to use eval?
154What is a Regular Expression?
155What are the string methods available in Regular expression?
156What are modifiers in regular expression?
157What are regular expression patterns?
158What is a RegExp object?
159How do you search a string for a pattern?
160What is the purpose of exec method?
161How do you change style of a HTML element?
162What would be the result of 1+2+'3'?
163What is a debugger statement?
164What is the purpose of breakpoints in debugging?
165Can I use reserved words as identifiers?
166How do you detect a mobile browser?
167How do you detect a mobile browser without regexp?
168How do you get the image width and height using JS?
169How do you make synchronous HTTP request?
170How do you make asynchronous HTTP request?
171How do you convert date to another timezone in javascript?
172What are the properties used to get size of window?
173What is a conditional operator in javascript?
174Can you apply chaining on conditional operator?
175What are the ways to execute javascript after page load?
176What is the difference between proto and prototype?
177Give an example where do you really need semicolon?
178What is a freeze method?
179What is the purpose of freeze method?
180Why do I need to use freeze method?
181How do you detect a browser language preference?
182How to convert string to title case with javascript?
183How do you detect javascript disabled in the page?
184What are various operators supported by javascript?
185What is a rest parameter?
186What happens if you do not use rest parameter as a last argument?
187What are the bitwise operators available in javascript?
188What is a spread operator?
189How do you determine whether object is frozen or not?
190How do you determine two values same or not using object?
191What is the purpose of using object is method?
192How do you copy properties from one object to other?
193What are the applications of assign method?
194What is a proxy object?
195What is the purpose of seal method?
196What are the applications of seal method?
197What are the differences between freeze and seal methods?
198How do you determine if an object is sealed or not?
199How do you get enumerable key and value pairs?
200What is the main difference between Object.values and Object.entries method?
201How can you get the list of keys of any object?
202How do you create an object with prototype?
203What is a WeakSet?
204What are the differences between WeakSet and Set?
205List down the collection of methods available on WeakSet?
206What is a WeakMap?
207What are the differences between WeakMap and Map?
208List down the collection of methods available on WeakMap?
209What is the purpose of uneval?
210How do you encode an URL?
211How do you decode an URL?
212How do you print the contents of web page?
213What is the difference between uneval and eval?
214What is an anonymous function?
215What is the precedence order between local and global variables?
216What are javascript accessors?
217How do you define property on Object constructor?
218What is the difference between get and defineProperty?
219What are the advantages of Getters and Setters?
220Can I add getters and setters using defineProperty method?
221What is the purpose of switch-case?
222What are the conventions to be followed for the usage of swtich case?
223What are primitive data types?
224What are the different ways to access object properties?
225What are the function parameter rules?
226What is an error object?
227When you get a syntax error?
228What are the different error names from error object?
229What are the various statements in error handling?
230What are the two types of loops in javascript?
231What is nodejs?
232What is an Intl object?
233How do you perform language specific date and time formatting?
234What is an Iterator?
235What is an event loop?
236What is call stack?
237What is an event queue?
238What is a decorator?
239What are the properties of Intl object?
240What is an Unary operator?
241How do you sort elements in an array?
242What is the purpose of compareFunction while sorting arrays?
243How do you reversing an array?
244How do you find min and max value in an array?
245How do you find min and max values without Math functions?
246What is an empty statement and purpose of it?
247How do you get meta data of a module?
248What is a comma operator?
249What is the advantage of a comma operator?
250What is typescript?
251What are the differences between javascript and typescript?
252What are the advantages of typescript over javascript?
253What is an object initializer?
254What is a constructor method?
255What happens if you write constructor more than once in a class?
256How do you call the constructor of a parent class?
257How do you get the prototype of an object?
258What happens If I pass string type for getPrototype method?
259How do you set prototype of one object to another?
260How do you check whether an object can be extendable or not?
261How do you prevent an object to extend?
262What are the different ways to make an object non-extensible?
263How do you define multiple properties on an object?
264What is MEAN in javascript?
265What Is Obfuscation in javascript?
266Why do you need Obfuscation?
267What is Minification?
268What are the advantages of minification?
269What are the differences between Obfuscation and Encryption?
270What are the common tools used for minification?
271How do you perform form validation using javascript?
272How do you perform form validation without javascript?
273What are the DOM methods available for constraint validation?
274What are the available constraint validation DOM properties?
275What are the list of validity properties?
276Give an example usage of rangeOverflow property?
277Is enums feature available in javascript?
278What is an enum?
279How do you list all properties of an object?
280How do you get property descriptors of an object?
281What are the attributes provided by a property descriptor?
282How do you extend classes?
283How do I modify the url without reloading the page?
284How do you check whether an array includes a particular value or not?
285How do you compare scalar arrays?
286How to get the value from get parameters?
287How do you print numbers with commas as thousand separators?
288What is the difference between java and javascript?
289Is javascript supports namespace?
290How do you declare namespace?
291How do you invoke javascript code in an iframe from parent page?
292How do get the timezone offset from date?
293How do you load CSS and JS files dynamically?
294What are the different methods to find HTML elements in DOM?
295What is jQuery?
296What is V8 JavaScript engine?
297Why do we call javascript as dynamic language?
298What is a void operator?
299How to set the cursor to wait?
300How do you create an infinite loop?
301Why do you need to avoid with statement?
302What is the output of below for loops?
303List down some of the features of ES6?
304What is ES6?
305Can I redeclare let and const variables?
306Is const variable makes the value immutable?
307What are default parameters?
308What are template literals?
309How do you write multi-line strings in template literals?
310What are nesting templates?
311What are tagged templates?
312What are raw strings?
313What is destructuring assignment?
314What are default values in destructuring assignment?
315How do you swap variables in destructuring assignment?
316What are enhanced object literals?
317What are dynamic imports?
318What are the use cases for dynamic imports?
319What are typed arrays?
320What are the advantages of module loaders?
321What is collation?
322What is for...of statement?
323What is the output of below spread operator array?
324Is PostMessage secure?
325What are the problems with postmessage target origin as wildcard?
326How do you avoid receiving postMessages from attackers?
327Can I avoid using postMessages completely?
328Is postMessages synchronous?
329What paradigm is Javascript?
330What is the difference between internal and external javascript?
331Is JavaScript faster than server side script?
332How do you get the status of a checkbox?
333What is the purpose of double tilde operator?
334How do you convert character to ASCII code?
335What is ArrayBuffer?
336What is the output of below string expression?
337What is the purpose of Error object?
338What is the purpose of EvalError object?
339What are the list of cases error thrown from non-strict mode to strict mode?
340Is all objects have prototypes?
341What is the difference between a parameter and an argument?
342What is the purpose of some method in arrays?
343How do you combine two or more arrays?
344What is the difference between Shallow and Deep copy?
345How do you create specific number of copies of a string?
346How do you return all matching strings against a regular expression?
347How do you trim a string at the beginning or ending?
348What is the output of below console statement with unary operator?
349Does javascript uses mixins?
350What is a thunk function?
351What are asynchronous thunks?
352What is the output of below function calls?
353How to remove all line breaks from a string?
354What is the difference between reflow and repaint?
355What happens with negating an array?
356What happens if we add two arrays?
357What is the output of prepend additive operator on falsy values?
358How do you create self string using special characters?
358How do you remove falsy values from an array?
359How do you get unique values of an array?
360What is destructuring aliases?
361How do you map the array values without using map method?
362How do you empty an array?
363How do you rounding numbers to certain decimals
364What is the easiest way to convert an array to an object?
365How do you create an array with some data?
366What are the placeholders from console object?
367Is it possible to add CSS to console messages?
368What is the purpose of dir method of console object?
369Is it possible to debug HTML elements in console?
370How do you display data in a tabular format using console object?
371How do you verify that an argument is a Number or not?
372How do you create copy to clipboard button?
373What is the shortcut to get timestamp?
374How do you flattening multi dimensional arrays?
375What is the easiest multi condition checking?
376How do you capture browser back button?
377How do you disable right click in the web page?
378What are wrapper objects?
379What is AJAX?
380What are the different ways to deal with Asynchronous Code?
381How to cancel a fetch request?
382What is web speech API?
383What is minimum timeout throttling?
384How do you implement zero timeout in modern browsers?
385What are tasks in event loop?
386What are microtasks?
387What are different event loops?
388What is the purpose of queueMicrotask?
389How do you use javascript libraries in typescript file?
390What are the differences between promises and observables?
391What is heap?
392What is an event table?
393What is a microTask queue?
394What is the difference between shim and polyfill?
395How do you detect primitive or non primitive value type?
396What is babel?
397Is Node.js completely single threaded?
398What are the common use cases of observables?
399What is RxJS?
400What is the difference between Function constructor and function declaration?
401What is a Short circuit condition?
402What is the easiest way to resize an array?
403What is an observable?
404What is the difference between function and class declarations?

Related Plugins

Latest Plugins