Wednesday, April 19, 2017

JavaScript Interview Questions & Answers


1. Some of the features of JavaScript
• An explanation of JavaScript language.
• JavaScript can be embedded directly into HTML pages
• It is a lightweight programming language.
• JavaScript pages are used to introduce the dynamic interactivity

2. " JavaScript called Interpreted language” - why?
JavaScript is interpreted language because the browser parses JavaScript code line-by-line and the equivalent machine code to create and show the computer code is executed.

3. Why is JavaScript weakly typed language?
JavaScript, typecasting one data type to another data type is not required to convert. The numeric data that contains no actors and no need to declare the data type of the variable data can contain the string value of the variable. For this reason, loosely JavaScript / is called weakly typed language.

4. What do you understand Undefined and null values?
Undefined value of a variable has been declared but has not yet been assigned a value. On the other hand, null values. It is as a representation of the value of a variable can be determined. Itself is a type of undefined (unspecified) when an object is null: Also, undefined and null are two distinct types.

5. What are the primitive data types?
Boolean, numeric, string, null and undefined values are the primitive data types. Primitives, a chunk of memory, depending on the type of stored data is primitive. And there is a certain amount of memory space primitives.

6. What is variable?
The values of a variable that can change a name or a program to transmit information on the condition depend on. The boolean value of a variable, such as data types, numbers, strings, etc. can contain different types of
var i = 0;

7. If you are a local variable and the global variable mean?
Global and local: variable has two major categories.
Global variables are accessible from anywhere in the program and maintain their value until the document unloaded.
Local variables functions call while on the other hand built for temporary use only those functions that are made accessible.

8. What you mean by Array? Declare an array?
Consecutive memory, which is a format similar data elements are stored in a collection. Always address the array position 0. JavaScript array object is regarded as the start. Each property is called an element of an array, and each element can be assigned a value. JavaScript can be declared a layout in the following ways...
Var myArray = new Array ();

9. What were the LIFO and FIFO-based approach is based on?
The LIFO-based methods are:
·         Push - Insert at the end of the list
·         Pop - remove from the end of the list

FIFO-based methods are:
·         unshift - insertion of the first
·         Shift - from the removal of the list

10. What is the objective plus the operator of the two?
Make numeric numbers.
 Concatenate the string data.

17. What is the meaning and function of the statement?
Ans: A function is a function of a "subprogram" The Code (repeated or internal) can be called external. The function body is called the sequence of statements. Values can be approved to a function, and the function cans arrival a value.
Exit Function statement to return values from functions, and are used to the caller.

20. What major event category?
Events can be divided into the following:
A) Keyboard events
B) Mouse events
C) A form of the event
D) Page / window / image event

22. HTML form to display the hierarchy.
HTML Form hierarchy
·         Window (object)
·         Document (window property)
·         Form (document property)
·         Material (in the form of property)
·         The material components of the value of the property)


24. Why is essential to object-oriented programming in JavaScript?
Lane, while essential to JavaScript
• And the script
• We need to modular programming
• We need to re-use script

25. What is Document Object Model (the DOM)?
The document itself, the document object model (the DOM) model that describes how all the elements of an HTML page, input fields, pictures, articles, etc., are related to municipal development. Call DOM element is the correct name, we can influence.

01.   Explain the three basic structure of JavaScript.
02.   Write the difference between if-then-else and switch-case structure.
03.   Write the difference between while and do-while loop.
04.   How For loop and For/in loop works?
05.   Describe the use of with statement.
06.   Write the difference between break and continuous statement.
07.   How many and how you can fire a function?
08.   Where return statement is used and How?
09.   How function constructor and function literals are declared?
10.   Show the hierarchy of HTML form.
11.   What are the five cross-browser properties of Screen object?
12.   Explain any five properties of the window object.
13.   Write the four timing method of the window object.
14.   Write the function of following methods:

Open ( ), close (), move by ( ), move to ( ), resize By ( ) and resize To ()
01.   What do you understand by prototype concept in JavaScript?
02.   Explain any five Tag methods of a string object.
03.   Explain any five action methods of the string object.
04.   Explain the four regular expression methods of the string object.
05.   Why object-oriented programming is essential in JavaScript?
06.   What is Document Object Model (DOM)?
07.   What are the benefits of the preloading image?
08.   Explain the four arguments of the open method of windows object.
09.   Explain the use of location object with an example.
10.   Explain the use of anchor object with an example.
11.   Explain the use of history object with an example.
12.   What are the mouse-events used in JavaScript?
13.   What are the key-events used in JavaScript?
14.   What are the form-events used in JavaScript?
15.   What are the page/window/image-events used in JavaScript?
16.   Describe how form arrays are used?

17.   What is the purpose of using hidden text in forms?
"Access Denied" error, i.e. what does it mean?
No browser "access denied" error occurs when a window or frame in another window or frame to a JavaScript file that contains the script is different from the domain of the document to access.

18.Is there an ASP script quickly than a JavaScript script?
Yes. Since JavaScript is a client-side script for the Web server does not require it to his calculations, so it's always fast, ASP, PHP, etc .. Than no server-side script
What is the difference between an alert box and a confirmation box?
The OK button which displays an alert box with a button box to display two buttons, such as OK and Cancel.
  

    01.   Write some features of JavaScript.
    02.   “JavaScript is called the interpreted language”- why?
    03.   Write the difference between HTML and JavaScript.
    04.   Why JavaScript is called weakly type language?
    05.   How many literals are available in JavaScript? Explain with example.
    06.   Write the function of, alert ( ), prompt ( ), parseInt ( ) and ParseFloat ( ).
    07.   What do you understand by Undefined and null values?
    08.   What is variable? How global and local variable works?
    09.   Write the difference between primitive and compound data.
    10.   What is an array? Explain the function of the following array methods: Array.pop ( ),          Array Pusher (), Array Shift (), Array unshift ( ), Array slice ( ) and Array. Splice ().
    11.   Write three methods of concatenating array elements.
    12.   What are the three categories of operators? Explain.                       

    13.   Write the function of new, delete and void operators.





No comments:

Post a Comment