JavaScript Flashcards
What is JavaScript?
JavaScript is a client-side as well as server side scripting language that can be inserted into HTML pages and is understood by web browsers. JavaScript is also an Object based Programming language
What are JavaScript Data Types?
Following are the JavaScript Data types:
Number String Boolean Object Undefined
What is the use of isNaN function?
isNan function returns true if the argument is not a number otherwise it is false.
Which company developed JavaScript?
Netscape is the software company who developed JavaScript.
What are undeclared and undefined variables?
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.
What is ‘this’ keyword in JavaScript?
‘This’ keyword refers to the object from where it was called.
What are all the looping structures in JavaScript?
Following are looping structures in Javascript:
For
While
do-while loops
How can you convert the string of any base to integer in JavaScript?
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 string.
Explain the difference between the double equals operator(“==”) and the triple equals operator (“===”)?
”==” 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.
What do mean by NULL in Javascript?
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.
What is an undefined value in JavaScript?
Undefined value means the
Variable used in the code doesn’t exist
Variable is not assigned to any value
Property doesn’t exist
What is the difference between an alert box and a confirmation box?
An alert box displays only one button which is the OK button.
But a Confirmation box displays two buttons namely OK and cancel.
What are JavaScript Cookies?
Cookies are the small test files stored in a computer and it gets created when the user visits the websites to store information that they need. Example could be User Name details and shopping cart information from the previous visits.
Which keyword is used to print the text in the screen?
document.write(“Welcome”) is used to print the text – Welcome in the screen.
What is the use of Push method in JavaScript?
The push method is used to add or append one or more elements to the end of an Array. Using this method, we can append multiple elements by passing multiple arguments