Javascript Interview Question Answer
1 - Javascript Error

Load time error-
When we do use proper javascript syntax,it generates errors dynamically.
For example
window.alrt('This is test msg');
here alrt is generate load time error

Run time error-
When code is correct there is no error by programmer, but when we run this code this will geneate error
For example
var x=10, y=0;
var z=x/y;
Division by zero generate run time error

Logical error-
when we are trying with bad logic so this is call logical error
Suppose we assign a value to the wrong variable may cause a series of unexpected program errors

2 - Differences between Java and Javascript

Java is a object programming language like C++,C#. Java is a compiled language and generate exe and Run complete code, In Java we can create webapplication means we can Java(JSP) is a server side scripting language, Java(Android) is use for developing app. we can also create desktop software, scientific applications and embedded systems.

But Javascript is client side scripting language specially use for webapplication for example we create form validation, slider and create menu etc. JavaScript is an interpreted language, not a compiled language, Javascript run code line by line.

3 - Difference between undefined variable and undeclared variable.

if declared variable in a code and we do not assign any value to the variable then javascript show
undefined value.

if we do not declared variable in a code so the javascript generate run time error showing runtime
error encountered.

4 - What is the difference between an alert box and a confirmation box?

Alert box show ok button where as Confirmation box show ok and cancel button

5 - How many type of Pop up boxes available in JavaScript?

1- Alert
2- Confirm
3- Prompt


Next

Share on Facebook
Success Story
Mamta kushwaha
Avatar
PHP Developer
India webpoint
Many of my relatives were in good jobs than what I had and my parents were worried about me. I was confident to find some way to get a better position. Then I found that the training through It and Dc was happy for the decision. I have my own business now and I am doing good in developing clients’sites to earn profits to make my parents happy.
Manikant kumar
Avatar
PHP Developer
Fourtek IT Solution PVT LTD
The regular knowledge at IT Training Online gave me the confidence to approach the best companies and I found the position in the corporate world I had been trying to get for a long time. The work that I do now satisfies me and gives me inspiration to perform better. I got this strength from IT Training Online when I was put under training in PHP and web development at the institute.
Sponsored Ads