2.How to read and write a file using javascript? I/O operations like reading or writing a file is not possible with client-side javascript. However , this can be done by coding a Java applet that reads files for the script. 3.How to detect the operating system on the client machine? In order to detect the operating system on the client machine, the navigator.appVersion string (property) should be used. 4.Where are cookies actually stored on the hard disk? This depends on the user's browser and OS. In the case of Netscape with Windows OS,all the cookies are stored in a single file called cookies.txt c:/Program Files/Netscape/Users/username
14.How to hide javascript code from old browsers that dont run it? Ans. Use the below specified style of comments <script language=javascript> <!-- javascript code goes here // --> or Use the <NOSCRIPT>some html code </NOSCRIPT> tags and code the display html statements between these and this will appear on the page if the browser does not support javascript 15. How to comment javascript code? Ans. Use // for line comments and /* */ for block comments 16.Name the numeric constants representing max,min values Ans. Number.MAX_VALUE Number.MIN_VALUE 17.What does javascript null mean? Ans. The null value is a unique value representing no value or no object. It implies no object,or null string,no valid boolean value,no number and no array object. 18.What does undefined value mean in javascript? Ans. Undefined value means the variable used in the code doesnt exist or is not assigned any value or the property doesnt exist. 19.What is the difference between undefined value and null value? Ans. (i)Undefined value cannot be explicitly stated that is there is no keyword called undefined whereas null value has keyword called null (ii)typeof undefined variable or property returns undefined whereas typeof null value returns object 20.What is variable typing in javascript? Ans. It is perfectly legal to assign a number to a variable and then assign a string to the same variable as follows example i = 10; i = "string"; This is called variable typing 21.Does javascript have the concept level scope? Ans. No.Javascript does not have block level scope,all the variables declared inside a function possess the same level of scope unlike c,c++,java. 22. What are undefined and undeclared variables? Ans. Undeclared variables are those that are not declared in the program (do not exist at all),trying to read their values gives runtime error.But if undeclared variables are assigned then implicit declaration is done . Undefined variables are those that are not assigned any value but are declared in the program.Trying to read such variables gives special value called undefined value. 23. What is === operator ? Ans. ==== is strict equality operator ,it returns true only when the two operands are having the same value without any type conversion. 24.What does the delete operator do? Ans. The delete operator is used to delete all the variables and objects used in the program ,but it does not delete variables declared with var keyword. 25.What does break and continue statements do? Ans. Continue statement continues the current loop (if label not specified) in a new iteration whereas break statement exits the current loop. 26.How to create a function using function constructor? Ans. The following example illustrates this It creates a function called square with argument x and returns x multiplied by itself. var square = new Function ("x","return x*x");