Question:- What is the difference between undefined value and null value?
Answer:- - Undefined value: A value that is not defined and has no keyword is known as undefined value. For example: int number;//Here, a number has an undefined value. - Null value: A value that is explicitly specified by the keyword "null" is known as a null value. For example: String str=null;//Here, str has a null value.
Question:- How to set the cursor to wait in JavaScript?
Answer:- The cursor can be set to wait in JavaScript by using the property "cursor". The following example illustrates the usage: window.document.body.style.cursor = "wait";
Question:- What is this [[[]]]?
Answer:- This is a three-dimensional array. var myArray = [[[]]];
Question:- Are Java and JavaScript same?
Answer:- No, Java and JavaScript are the two different languages. Java is a robust, secured and object-oriented programming language whereas JavaScript is a client-side scripting language with some limitations.
Question:- What is negative infinity?
Answer:- Negative Infinity is a number in JavaScript which can be derived by dividing the negative number by zero.
Question:- What is the difference between View state and Session state?
Answer:- "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.
Question:- What are the pop-up boxes available in JavaScript?
Answer:- - Alert Box - Confirm Box - Prompt Box
Question:- How can we detect OS of the client machine using JavaScript?
Answer:- The navigator.appVersion string can be used to detect the operating system on the client machine.
Question:- Is JavaScript faster than ASP script?
Answer:- Yes, because it doesnt require web servers support for execution.
Question:- How to handle exceptions in JavaScript?
Answer:- By the help of try/catch block, we can handle exceptions in JavaScript. JavaScript supports try, catch, finally and throw keywords for exception handling.
Question:- What is the requirement of debugging in JavaScript?
Answer:- JavaScript didnt show any error message in a browser. However, these mistakes can affect the output. The best practice to find out the error is to debug the code. The code can be debugged easily by using web browsers like Google Chrome, Mozilla Firebox. To perform debugging, we can use any of the following approaches: Using console.log() method Using debugger keyword
Question:- What is the use of debugger keyword in JavaScript?
Answer:- JavaScript debugger keyword sets the breakpoint through the code itself. The debugger stops the execution of the program at the position it is applied. Now, we can start the flow of execution manually. If an exception occurs, the execution will stop again on that particular line.
Question:- What is the role of a strict mode in JavaScript?
Answer:- The JavaScript strict mode is used to generates silent errors. It provides "use strict"; expression to enable the strict mode. This expression can only be placed as the first statement in a script or a function.
Question:- What is the use of a Date object in JavaScript?
Answer:- The JavaScript date object can be used to get a year, month and day. You can display a timer on the webpage by the help of JavaScript date object.
