Home | About Us | Contact Us | Terms Of Use
JavaScript is a script language - a system of programming codes, created by Netscape, that can be embedded into the HTML of a web page to add functionality. JavaScript should not be confused with the Java programming language. In general, script languages such as JavaScript are easier and faster to code than more structured languages such as Java and C++.
JavaScript Interviews are getting tough these days as the technology grows faster. To get through the JavaScript interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed JavaScript questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on JavaScript and various other technologies interview preparation.
1. Are Java and JavaScript the Same?
No.java and javascript are two different languages. Java is a powerful object - oriented programming language like C++,C whereas Javascript is a client-side scripting language with some limitations.
2. Can javascript code be broken in different lines?
Breaking is possible within a string statement by using a backslash \ at the end but not within any other javascript statement. that is , document.write("Hello \ world"); is possible but not document.write \ ("hello world");
3. How about 2+5+"8"?
Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it?s concatenation, so 78 is the result.
4. How do you assign object properties?
obj["age"] = 17 or obj.age = 17.
5. How do you convert numbers between different bases in JavaScript?
Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);
6. How do you create a new object in JavaScript?
var obj = new Object(); or var obj = {};
7. How to access an external javascript file that is stored externally and not embedded?
This can be achieved by using the following tag between head tags or between body tags.
8. How to embed javascript in a web page?
javascript code can be embedded in a web page between tags
9. How to hide javascript code from old browsers that dont run it?
Use the below specified style of comments
10. 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.