Quantcast
Channel: The Code Developer » Javascript
Viewing all articles
Browse latest Browse all 2

JavaScript Interview Questions and Answers

$
0
0

1.what is JavaScript?
Ans-JavaScript is a scripting language that can be inserted into HTML pages and is understood by web browsers. It is different from Java language. It is object-based, lightweight and cross platform.

2. What are JavaScript types?
Ans-There are the several JavaScript types:  46016a9cdce499cdf5715f06e7e82469
Number
String                                                                   
Boolean
Function
Object
Null
Undefined

3.JavaScript vs. Jscript?
Ans-Both JavaScript and Jscript are almost similar. Java script was developed by Netscape and Microsoft implemented its own scripting language known as Jscript.

4.What is BOM and DOM?
Ans- BOM stands for Browser Object Model. It provides interaction with the browser. The default object of browser is window.
DOM stands for Document Object Model. A document object represent the html document. It can be used to access and change the content of html.

5.What is negative infinity?
Ans-Negative Infinity is a number in JavaScript which can be derived by dividing negative number by zero.

6.Is JavaScript case sensitive language?
Ans-Yes,JavaScript is a case sensitive language.

7.What is the difference between null value and undefined value?
Ans-Null value: A value that is explicitly specified by the key word ‘null’ is known as null value. For example in the declaration, String str=null; the str has a null value. The keyword ‘null’ is used here.

Undefined value: A value that is not defined and has no keyword is known as undefined value. For example in the declaration, int number; the number has undefined value.

8.What is a prompt box?
Ans-A prompt box is a box which allows the user to enter input by providing a text box. Label and box will be provided to enter the text or number.

9.What is the difference between SessionState and ViewState?
Ans- Session State is specific to user specific data that can be accessed across all pages in the web application.
View State is specific to a page in a session.

10.What are the JavaScript data types?
Ans- There are two types of data types-
1)Primitive
2)Non-Primitive

1)Primitive:                                                              qanda
String                         
Number                      
Boolean                      
Undefined                  
Null
2)Non-Primitive:
Object                         
Array                          
RegExp

11.What is the output of 10+20+”30″ in JavaScript?
Ans-3030 because 10+20 will be 30. If there is numeric value before and after +, it is treated is binary + (arithmetic operator).

12.What is the output of “10”+20+30 in JavaScript?
ans- 102030 because after a string all the + will be treated as string concatenation operator (not binary +).


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images