Java Script Interview Questions and Answers

What is JavaScript?
JavaScript is a scripting language, designed to add interactivity to HTML pages, JavaScript is usually embedded directly into HTML pages, and JavaScript is an interpreted language (means that scripts execute without preliminary compilation) JavaScript is a platform-independent, event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems.
Define JavaScript Variables?

JavaScript is case-sensitive, variable names are case-sensitive. Creating variables in JavaScript is most often referred to as "declaring" variables. You declare JavaScript variables with the var keyword:
Var x;
Var fu='hi';
Var gf=3.45;

What is variable typing in java script?
It is perfectly legal to assign a number to a variable and then assign a string to the same variable as follows example i = 10; i = 'stringchar'; This is called variable typing
How do you create an object in JavaScript?
var person = new Object; or var person = {};

Are Java and JavaScript the same?
NO! Java and JavaScript are two completely different languages in both concept and design! Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++. JavaScript’s syntax is loosely based on Java
What's relationship between JavaScript and ECMA Script?

ECMA Script is yet another name for JavaScript (other names include Live Script). The current JavaScript that you see supported in browsers is ECMA Script revision 3. Java Script is a scripting language that has been widely accepted for client side web development. However it originated from ECMA standards. ECMA and live scripts are just other names of java script.

What Boolean operators does JavaScript support?
&&, || ,!

What looping structures are there in JavaScript?
For, while, do-while loops
What is the difference between undefined value and null value?
Undefined means a variable has been declared but has not yet been assigned a value. On the other hand, null is an assignment value. It can be assigned to a variable as a representation of no value. Also, undefined and null are two distinct types: undefined is a type itself (undefined) while null is an object. Unassigned variables are initialized by JavaScript with a default value of undefined. JavaScript never sets a value to null. That must be done programmatically.
What data types are supported in Java Script?
Number, String, Undefined, null, Boolean
Explain a JavaScript Comments?

Comments can be added to explain the JavaScript, or to make the code more readable.
Single line comments start with //.
Multi line comments start with /* and end with */

What does the tag do?
Displayed the text enclosed within tag when JavaScript is disabled

Latest Updates

General Knowledge of India

In 1897, the Birsa Movement supporters raised which colour flag as a symbol of Birsa Raj?

Ratio and Proportion

The cost of 10 books is Rs. 80/-. Find the value of 15 books?

The cost of 48 bags of paddy is Rs. 16,800/-. What is the cost of 36 bags of paddy?

Monthly expenditure of a family of 4 members is Rs 2800/-. What is the expenditure if there are 3 members in the family?

Annual incomes of the families of Sita and Latha are in the ratio 4:3 and their annual expenditure are in the ratio 3:2. What is their annual income if they save Rs. 3000/- in a year?

A certain sum of money is divided between A and B in the ratio of 5/4 : 5/3 and A got Rs. 360/-. Find the total sum of money and B’s share?

In an office, the ratio of the salaries of an officer and a clerk is 15:7. If the salary of a clerk is Rs. 720/- less than the salary of the officer, find the salary of each?

In an election to a municipal council, the votes secured by two candidates are in the ratio 13:19. The elected candidates gets 312 votes more than the second candidate. How many votes are secured by the second candidate?

A certain sum of money is divided between Murthy and Prasad in the ratio 22/7 : 8/3. If Murthy gets Rs. 120/- more than Prasad, find the share of each?

In a cricket test series, the runs made by Raju and Tendulkar are in the ratio 5:9 and Tendulkar and Azar are in the ratio 6:7. What are the runs made by them if Azar makes 187 runs more than Raju?

If A:B = 2:3 and B:C = 9:5 find A:B:C?

If A:B = 3/5:5/7 and B:C = 3/4:2/5, find A:B:C?

If R:S = 0.01:0.11 and S:T = 2.2:1, Find R:S:T?

In a school, Under a Saving Scheme, Rekha saves 3/2 times the savings of Bindu, Geeta saves 4 times the savings of Rekha. Find the ratio of the savings of all the three in least terms?

Simplification

A man left 1/3 rd of his property to his wife and 3/5 th of the remainder to his daughter. He gave the rest to his son who received Rs. 6400/-. How much was his original property worth?

Ratio and Proportion

In a school 4/9 of the pupils are boys. There are 125 girls. How many boys are there?

If A:B = 3:4 and B:C = 5:6, find A:C?

IF X:Y = 3:4 AND Y:Z = 4:5, FIND X:Y:Z?