- Interpreted programming language
- Good for the applications which are network-centric
- Complementary to Java
- Complementary to HTML
- Open source
- Server interaction is less
- Feedback to the visitors is immediate
- Interactivity is high
- Interfaces are richer
- No support for multithreading
- No support for multiprocessing
- Reading and writing of files is not allowed
- No support for networking applications.
The function which has named at the time of definition is called a named function. For example
7) Name the types of functions
The types of function are:
- Named – These type of functions contains name at the time of definition. For Example:
- Anonymous – These type of functions doesn’t contain any name. They are declared dynamically at runtime.
8) 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:
9) Can an anonymous function be assigned to a variable?
Yes, you can assign an anonymous function to a variable.
11) Define closure.
12) 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.
18) 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,
19) 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.
20) What is the use of window object?
The window object is used to display the popup dialog box. Let’s see with description.
|alert()||displays the alert box containing the message with ok button.|
|confirm()||displays the confirm dialog box containing the message with ok and cancel button.|
|prompt()||displays a dialog box to get input from the user.|
|open()||opens the new window.|
|close()||closes the current window.|
|setTimeout()||performs the action after specified time like calling function, evaluating expressions.|