JAVASCRIPT INTERVIEW PREPARATION
PART-1
- What is JavaScript?
- List some features of JavaScript.
- Who developed JavaScript, and what was the first name given for it?
- List a number of the benefits of JavaScript.
- List a number of the negative aspects of JavaScript.
- Explain the difference between JavaScript and JScript.
- Name the types of functions.
- What is an anonymous function in JavaScript?
- In JavaScript, can an anonymous function be assigned to a variable?
- In JavaScript, if we want to return the character from a specific index which
- method can be used?
- How to use an external JavaScript file?
- Explain how to write HTML code dynamically using JavaScript language?
- What is the real name of the JavaScript language?
- What is the difference between == and ===?
- Which are the pop-up boxes available in JavaScript?
- How to create objects in JavaScript?
• Lightweight• Interpreted programming language• Good for the applications which are network-centric• Complementary to Java• Complementary to HTML• Open-source• Cross-platform
• Server interaction is less• Feedback to the visitors is immediate• Interactivity is high• Interfaces are richer
• No support for multithreading.• No support for multiprocessing.• Writing and reading of files are not allowed.• No support for networking applications.
function display(){document.writeln("Named Function in invoked");}display();
var display=function(){document.writeln("Anonymous Function");}display();
var display=function(){alert("The Anonymous Function is called");}display();
Yes, we are able to assign an anonymous function to a variable.
Var msg = "JavaScript is scripting language";function display(){document.writeln(msg);}display();
12. Explain how to write HTML code dynamically using JavaScript language?
The property innerHTML is used to write the HTML code using JavaScript
dynamically.
Example:
document.getElementById('mylocation').innerHTML="Text";
13. What is the real name of the JavaScript language?
The original name of the JavaScript was "Mocha", a name chosen by Marc Andreessen, founder of Netscape. In 1995, the name was changed to "LiveScript". In 1995, the name JavaScript was adopted.
14.What is the difference between == and ===?
The == operator checks equality only.
The === checks equality and data type, i.e., a value must be of the same type.
15. Which are the pop-up boxes available in JavaScript?
• Alert Box
• Confirm Box
• Prompt Box
16. How to create objects in JavaScript?
There are three ways to create an object in JavaScript.
1. By object literal
2. By creating an instance of Object
3. By Object Constructor
Example for creating an object using object literal:-
emp={id:102,name:"Rahul",salary:55000}
- JavaScript Interview Preparation Part-2 : Click Here
- free Html & CSS Courses with certification : click here
- CSS Interview Preparation : click here
- Html Interview Preparation Part-2 : Click Here
0 Comments