The function which has named at the time of definition is called a named function. For example
6) Name the types of functions
The types of function are:
7) Define anonymous function
It is a function that has no name. These functions are declared dynamically at runtime using the function operator instead of the function declaration. The function operator is more flexible than a function declaration. It can be easily used in the place of an expression. For example:
8) Can an anonymous function be assigned to a variable?
Yes, you can assign an anonymous function to a variable.
10) Define closure.
11) If we want to return the character from a specific index which method is used?
I am assuming that js file name is message.js, place the following script tag inside the head tag.More details.
16) What is BOM?
BOM stands for Browser Object Model. It provides interaction with the browser. The default object of a browser is a window. So, you can call all the functions of the window by specifying the window or directly. The window object provides various properties like document, history, screen, navigator, location, innerHeight, innerWidth,More Details: Browser Object Model
17) What is DOM? What is the use of document object?
DOM stands for Document Object Model. A document object represents the HTML document. It can be used to access and change the content of HTML.More Details: Document Object Model
18) What is the use of window object?
The window object is used to display the popup dialog box. Let's see with description.
19) What is the use of history object?
The history object of a browser can be used to switch to history pages such as back and forward from the current page or another page. There are three methods of history object.
23) What is the difference between == and ===?
The == operator checks equality only whereas === checks equality, and data type, i.e., a value must be of the same type.
Let's see a simple code to create an object using object literal.More details.
Let's see a simple code to create an array using object literal.More details.
28) What does the isNaN() function?
The isNan() function returns true if the variable value is not a number. For example:
3030 because 10+20 will be 30. If there is numeric value before and after +, it treats as binary + (arithmetic operator).
102030 because after a string all the + will be treated as string concatenation operator (not binary +).
32) In which location cookies are stored on the hard disk?
The storage of cookies on the hard disk depends on the OS and the browser.
The Netscape Navigator on Windows uses a cookies.txt file that contains all the cookies. The path is c:\Program Files\Netscape\Users\username\cookies.txt
The Internet Explorer stores the cookies on a file firstname.lastname@example.org. The path is: c:\Windows\Cookies\username@Website.txt.
34) What is the difference between undefined value and null value?
Undefined value: A value that is not defined and has no keyword is known as undefined value. For example:
Null value: A value that is explicitly specified by the keyword "null" is known as a null value. For example:
36) What is this [[]]?
This is a three-dimensional array.
38) What is negative infinity?
39) What is the difference between View state and Session state?
"View state" is specific to a page in a session whereas "Session state" is specific to a user or browser that can be accessed across all pages in the web application.
The navigator.appVersion string can be used to detect the operating system on the client machine.
Yes, because it doesn't require web server's support for execution.
The this keyword is a reference variable that refers to the current object. For example:
To perform debugging, we can use any of the following approaches:
Other Interview QuestionsCore Java Interview Questions
Servlet Interview Questions
JSP Interview Questions
SQL Interview Questions
PL/SQL Interview Questions
Android Interview Questions