5. Explain about isNaN() function?
Ans. isNaN() function returns true if the argument is not a number otherwise it is false.
7. Explain negative infinity?
8. What are global variables? How are these variable declared and what are the problems associated with using them in java script?
Ans. Global variables are those that are available throughout the length of the code, that is, these have no scope. The “var” keyword is used to declare a local variable or object. If the “var” keyword is omitted, a global variable is declared.
// Declare a global global_variable = "Hello";
The problems that are faced by using global variables are the clash of variable names of local and global scope. Also, it is difficult to debug and test the code that relies on global variables.
9. What are undeclared and undefined variables?
Ans. Undeclared variables are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared variable, then a runtime error is encountered.
Undefined variables are those that are declared in the program but have not been given any value. If the program tries to read the value of an undefined variable, an undefined value is returned.
Ans. Yes, breaking within a string statement can be done by the use of a backslash, ‘\’, at the end of the first line.