Java Script Interview Questions and Answers Part 3

1. Explain how to read and write a file using JavaScript?

Ans. There are two ways to read and write a file using JavaScript

Using JavaScript extensions

Using a web page and Active X objects

2. What are all the looping structures in JavaScript?

Ans. Following are looping structures in Javascript:



do-while loops

3. 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.

4. What would be the result of 3+2+"7"?

Ans. Since 3 and 2 are integers, they will be added numerically. And since 7 is a string, its

concatenation will be done. So the result would be 57.

5. Explain how to detect the operating system on the client machine?

Ans. In order to detect the operating system on the client machine, the navigator.appVersion string

(property) should be used.

6. What do mean by NULL in Javascript?

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.

7. What is the function of delete operator?

Ans. The functionality of delete operator is used to delete all variables and objects in a program but it cannot delete variables declared with VAR keyword.

8. What are all the types of Pop up boxes available in JavaScript?

Ans. Alert,  Confirm and, Prompt

9. What is the use of Void(0)?

Ans. Void(0) is used to prevent the page from refreshing and parameter "zero" is passed

         While calling.

         Void(0) is used to call another method without refreshing the page.

10. What is an undefined value in JavaScript?

Ans. Undefined value means the Variable used in the code doesn’t exist

Variable is not assigned to any value Property doesn’t exist


Receive Quality Tutorials Straight in your Inbox by submitting your Email below:

Delivered by FeedBurner

Protected by Copyscape Duplicate Content Checker