1. What is a prompt box?
Ans. A prompt box is a box which allows the user to enter input by providing a text box. Label and box will be provided to enter the text or number.
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, setInterval 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, delay) function is used to repeatedly execute the given function in the mentioned delay and only halts when cancelled.
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.
Ans. ‘This’ keyword is used to point at the current object in the code. For instance: If the code is presently at an object created by the help of the ‘new’ keyword, then ‘this’ keyword will point to the object being created.
Ans. // for Single line comments and
5. What is the difference between ViewState and SessionState?
Ans. ‘ViewState’ is specific to a page in a session.
‘SessionState’ is specific to user specific data that can be accessed across all pages in the web application.
8. What is === operator?
Ans. === is called as strict equality operator which returns true when the two operands are having the same value without any type conversion.
Ans. The parseInt() function is used to convert numbers between different bases. parseInt() takes the string to be converted as its first parameter, and the second parameter is the base of the given
Ans. Variable typing is used to assign a number to a variable and the same variable can be assigned
to a string.