1. What is JavaScript?
JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage.
2. Which company developed JavaScript?
Netscape is the software company that developed JavaScript.
3. What are JavaScript Data Types?
Following are the JavaScript Data types: Number String Boolean Object Undefined
4. What is the use of isNaN function?
isNan function returns true if the argument is not a number; otherwise, it is false.
5. What is negative Infinity?
Negative Infinity is a number in JavaScript which can be derived by dividing negative number by zero.
6. Is it possible to break JavaScript Code into several lines?
Breaking within a string statement can be done by using a backslash, ‘\,’ at the end of the first line.
7. What is the meaning of scope of a variable in JavaScript?
The scope of a variable implies where the variable has been declared or defined in a JavaScript program.
8. What are the types of scopes of a variable in JavaScript?
Global scope and local scope.
9. What are global variables?
Global variables are available throughout the length of the code so that it has no scope.
10. What are local variables?
Local variables are accessible only within the function in which they are defined.
11. What is the ‘this’ keyword in JavaScript?
The ‘this’ keyword in JavaScript refers to the currently calling object.
12. What is Callback in JavaScript?
A callback is a JavaScript function passed to another function as an argument or a parameter. This function is to be executed whenever the function that it is passed to gets executed.
13. How do you debug a JavaScript code?
All modern web browsers, such as Chrome, Firefox, etc., have an inbuilt debugger that can be accessed anytime by pressing the relevant key, usually the F12 key.
14. What is a prompt box?
A prompt box is a box that allows the user to enter input by providing a text box. A label and box will be provided to enter the text or number.
15. What is
16. Does JavaScript support automatic type conversion?
Yes, JavaScript does support automatic type conversion. It is the common way of type conversion used by JavaScript developers
17. How to read and write a file using JavaScript?
Using JavaScript extensions Using a web page and Active X objects
18. What are all the looping structures in JavaScript?
For, While and Do-while loops
19. What is called Variable typing in Javascript?
Variable typing is used to assign a number to a variable. The same variable can be assigned to a string.
20. How can you convert the string of any base to an integer in JavaScript?
The parseInt() function is used to convert numbers between different bases.
21. How to detect the operating system on the client machine?
In order to detect the operating system on the client machine, the navigator. Platform string (property) should be used.
22. What do you mean by NULL in Javascript?
The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number, and no array object.
23. What is the function of the delete operator?
The delete keyword is used to delete the property as well as its value.
24. What are all the types of Pop up boxes available in JavaScript?
Alert, Confirm and Prompt
25. What is the use of Void (0)?
Void(0) is used to prevent the page from refreshing, and parameter “zero” is passed while calling.
26. What is the data type of variables in JavaScript?
All variables in JavaScript are object data types.
27. What are escape characters?
Escape characters (Backslash) is used when working with special characters like single quotes, double quotes, apostrophes, and ampersands.
28. What are JavaScript Cookies?
Cookies are the small test files stored in a computer, and they get created when the user visits the websites to store information that they need.
29. Does JavaScript has concept level scope?
No. JavaScript does not have concept-level scope. The variable declared inside the function has scope inside the function.
30. What is the use of a type of operator?
‘Typeof’ is an operator used to return a string description of the type of a variable.
31. Which keywords are used to handle exceptions?
Try… Catch—finally is used to handle exceptions in the JavaScript.
32. What is the use of the blur function?
Blur function is used to remove the focus from the specified object.
33. How to find an operating system in the client machine using JavaScript?
The ‘Navigator. the app version is used to find the operating system’s name in the client machine.
34. What are the different types of errors in JavaScript?
Load time errors, Runtime errors and Logical errors.
35. What is the use of the Push method in JavaScript?
The push method is used to add or append one or more elements to an Array end.
36. What is the unshift method in JavaScript?
Unshift method is like the push method, which works at the beginning of the array.
37. What is the Strict Mode in JavaScript?
Strict Mode adds certain compulsions to JavaScript. Under the strict Mode, JavaScript shows errors for a piece of code, which did not show an error before, but might be problematic and potentially unsafe.
38. How Strict Mode it be enabled?
Strict mode can be enabled by adding the string literal “use strict” above the file.
39. What is a window.onload?
The onload function is not run until all the information on the page is loaded. This leads to a substantial delay before any code is executed.
40. What is onDocumentReady?
onDocumentReady loads the code just after the DOM is loaded. This allows early manipulation of the code.
41. How closures work in JavaScript?
The closure is a locally declared variable related to a function that stays in memory when it has returned.
42. What are the arrow functions in JavaScript?
Arrow functions are a short way of writing functions in JavaScript.
43. What are the ways of defining a variable in JavaScript?
Var, Const and Let
44. What are Imports and Exports in JavaScript?
Imports and exports help in writing modular code for our JavaScript applications. With the help of imports and exports, we can split JavaScript code into multiple files in a project.
45. What are some of the JavaScript frameworks and their uses?
React, Angular and Node
46. Explain Hoisting in javascript.
Hoisting in javascript is the default process behavior of moving the declaration of all the variables and functions on top of the scope where scope can be local or global.
47. What is Implicit Type Coercion in javascript?
When the value of one data type is automatically converted into another, it is called Implicit type coercion in javascript.
48. Is javascript a statically typed or a dynamically typed language?
Yes, JavaScript is a dynamically typed language and not statically.
49. What is NaN property in JavaScript?
NaN property in JavaScript is the “Not-a-Number” value that is not a legal number.
50. What are Higher Order Functions?
Higher-order functions are the functions that take functions as arguments and return them by operating on other functions.
51. What are Self Invoking Functions?
Self Invoking Functions is an automatically invoked function expression followed by (), where it does not need to be requested.
52. What is currying in JavaScript?
In JavaScript, when a function of an argument is transformed into functions of one or more arguments, it is called Currying.
53. What is memoization ?
In JavaScript, memoization is when we want to cache the return value of a function concerning its parameters.
54. What is the use of a constructor function?
Constructor functions are used to create single objects or multiple objects with similar properties and methods.
55. Which method retrieves a character from a certain index?
We can retrieve a character from a certain index with the help of charAt() function method.
56. What is BOM?
BOM is the Browser Object Model where users can interact with browsers that is a window, an initial object of the browser.
57. Explain the Concept of Prototypes in JavaScript.
Prototypes are a mechanism used by JavaScript objects for inheritance. Every JavaScript object has a prototype, which provides properties and methods that can be accessed by that object.
58. What is the prototype design pattern?
The Prototype design Pattern is also known as a property or prototype pattern used to produce different objects and prototypes that are replicated from a template with a specific value.
59. What are generator functions?
Generator functions are declared with a special class of functions and keywords using function*.
60. What is WeakSet?
WeakSet is a collection of unique and ordered elements that contain only objects which are referenced weakly.
61. What is the use of callbacks?
A callback function sends input into another function and is performed inside another function.
62. What is a WeakMap?
Weakmap is referred to as an object having keys and values; if the object is without reference, it is collected as garbage.
63. What is Object Destructuring?
Object destructuring is a method to extract elements from an array or an object.
64. What is a Temporal Dead Zone?
Temporal Dead Zone is a behavior that occurs with variables declared using let and const keywords before they are initialized.
65. What is the role of deferred scripts?
The Deferred scripts are used for the HTML parser to finish before executing it.
66. What is Lexical Scoping?
Lexical Scoping in JavaScript can be performed when the internal state of the JavaScript function object consists of the function’s code and references concerning the current scope chain.
67. How do you remove duplicates from a JavaScript array?
There are two ways in which we can remove duplicates from a JavaScript array: By using the Filter Method By using the For Loop
68. What is an event loop in JavaScript?
It refers to a JavaScript process that allows multiple task handling without impact on the main thread.
69. What is bind() in JavaScript?
The bind function in JavaScript allows method borrowing from one object to another. It also preserves ‘this’.
70. What is the setInterval() method?
This function is used in JavaScript for iterative execution of a given function at the stated time intervals.
71. What is event bubbling?
JavaScript allows DOM elements to be nested inside each other. In such a case, if the handler of the child is clicked, the handler of the parent will also work as if it were clicked too.
72. How can a particular frame be targeted, from a hyperlink, in JavaScript?
This can be done by including the name of the required frame in the hyperlink using the ‘target’ attribute.
73. What are Screen objects?
Screen objects are used to read the information from the client’s screen.
74. What is escape() function?
The escape () function is responsible for coding a string to transfer the information from one computer to the other across a network.
75. What is unescape() function?
The unescape() function decodes the coded string.
76. What is encodeURI()?
EncodeURl() is used to convert URL into their hex coding.
77. What is decodeURI()?
DecodeURI() is used to convert the encoded URL back to normal.
78. Why you should not use innerHTML in JavaScript?
innerHTML content is refreshed every time and thus is slower. There is no scope for validation in innerHTML. Therefore, it is easier to insert rogue code in the document and make the web page unstable.
79. What Is Recursion in JavaScript?
Recursion is a programming technique that allows a function to call itself.
80. What Is the Difference Between null and undefined?
null is an assignment value that represents no value or an empty value, while undefined is a variable that has been declared but not assigned a value.
81. What Is Event Delegation in JavaScript
Event delegation is a technique where you attach a single event listener to a parent element, and that event listener handles events occurring on its child elements.
82. How Can You Clone an Object in JavaScript?
We can clone an object usng Object.assign() method or the spread operator (...).
83. What Are Promises in JavaScript?
Promises are objects used for asynchronous operations. They represent the eventual completion or failure of an asynchronous operation and allow chaining and handling of success or error cases.
84. What Is the Purpose of the setTimeout() Function in JavaScript?
The setTimeout() function is used to delay the execution of a function or the evaluation of an expression after a specified amount of time in milliseconds.
85. How can You Prevent the Default Behavior of an Event in JavaScript?
You can use the preventDefault() method on the event object within an event handler to prevent the default behavior associated with that event.
86. How Can You Convert a String to Lowercase in JavaScript?
You can use the toLowerCase() method to convert a string to lowercase in JavaScript.
87. What Is the Purpose of the map() Function in JavaScript?
The map() function is used to iterate over an array and apply a transformation or computation on each element.
88. What is the Purpose of the reduce() Function in JavaScript?
The reduce() function is used to reduce an array to a single value by applying a function to each element and accumulating the result.
89. What is the Purpose of the fetch() function in JavaScript?
The fetch() function is used to make asynchronous HTTP requests in JavaScript.
90. What is the Purpose of the window Object in JavaScript?
The window object represents the browser window. The window object can be used to access the browser’s features, such as the location bar, the status bar and the bookmarks bar.
91. What is ECMAScript?
ECMAScript(European Computer Manufacturers Association Script) is a scripting programming language based on JavaScript and is widely used for the World Wide Web for client-side scripting.
92. What are ArrayBuffers?
ArrayBuffers is a data type used to store a generic, fixed-length binary data buffer.
93. What is Callback hell?
Callback hell is also known as the Pyramid of Doom. It is an anti-pattern of multiple nested callbacks, making it difficult to read or debug the code.
94. What is the noscript tag used for?
To display the contents by non-JavaScript based browsers.
95. What is used to make the function appear to be synchronous?
await is used to make the function appear to be synchronous.
96. What is the difference between innerHTML & innerText?
innerHTML – It will process an HTML tag if found in a string innerText – It will not process an HTML tag if found in a string
Share this protal to share friends and complete unlimited tests here. You can also make friends on our protal also start mutual competition tests with your firends easily.