- symbol- added in ES6!
Ans: Undefined value means the
Variables used in the code don’t exist variable is not assigned to any valued property doesn’t exist.
3. What is negative infinity?
5. What are undeclared and undefined variables?
Ans: Undeclared variables are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared variable, then a runtime error is encountered.
Undefined Variables are those that are declared in the program but have not been given any value. If the program tries to read the value of an undefined variable, an undefined value is returned.
Ans: “This” keyword refers to the object from where it was called.
Ans: Timers are used to execute a piece of code at a set time or also to repeat the code in a given interval of time. This is done by using the functions setTimeout, set intervals, and clearInterval.
The setTimeout(function, delay) function is used to start a timer that calls a particular function after the mentioned delay. The setInterval(function delayed) function is used to repeatedly execute the given function in the mentioned delay and only halts when canceled. The clearInterval(id) function instructs the timer to stop.
Timers are operated within a single thread, and thus events might queue up, waiting to be executed.
9. What is === operator?
===is called a strict equality operator which returns true when the two operands are having the same value without any type of conversion.
- do-while loops
11. Explain the difference between “==” and “===”?
Ans: “==” checks only for equality in value whereas “===” is a stricter equality test and returns false if either the value or the type of the two variables are different.
Ans: 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.
Ans: It is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complementary to and integrated with Java. It is an open and cross-platform scripting language.
16. What is a closure? Give an example.
17. What is a callback?
18. Explain the window.onload and onDocumentReady?
Ans: 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. onDocumentReady loads the code just after the DOM is loaded. This allows early manipulation of the code.
Ans: The ‘Navigator.appversion’ is used to find the name of the operating system in the client machine.
20. What is the use of blur function?
Ans: The blur function is used to remove the focus from the specified object.
2. Which of the following function of the String object is used to match a regular expression against a string?
5. What method returns the characters in a string beginning at the specified location?
6. Which of the following function of array object creates a new array with the results of calling a provided function on every element in this array?
7. What attribute needs to be changed to make elements invisible?
9. What function of a String object splits a String object into an array of strings by separating the string into substrings?
Source: Oleh Lazareko and Neha Kumari from Playstore…