Javascript interview questions and answers for freshers and experienced

                                 What is JavaScript?

JavaScript is a loosely-type client side scripting language that execute in the user's browser.JavaScript interact with html elements in order to make interactive web user interface.JavaScript can be used in various activities like data validation,display popup message.

Javascript interview questions and answers
Javascript interview questions and answers

Q.1 Can you access Cookie using javascript?

Q.2 Can you assign a anonymous function to a variable?
 Yes,But Anonymous JavaScript function assigned to a variable can be called at a later time.

Q.3 Define unescape() and escape() functions?
 See this:

Q.4 Is a javascript script faster than an ASP script?
 Yes, javascript is faster than ASP script.Because javascript is develop for client side whereas ASP  Script is server side.

Q.5 Can you pass a anonymous function as an argument to another function?
 See this:

                                     Javascript tricky interview questions

Q.6 Does JavaScript support automatic type conversion?
 Yes! Javascript support automatic type conversion.

Q.7 Explain the difference between “==” and “===”?
 See this:

Q.8 How to read and write a file using javascript?
 By using java script functions – fopen(),fread() and fwrite().

Q.9 How to delete a Cookie using JavaScript?
 See this:

Q.10 How to print a web page using javascript?

                                       Javascript tricky interview questions

Q.11 How to read elements of an array in JavaScript?
 var fruit = ["Mango", "Apple", "Banana"];
 var arry_name=["Item1","Item2","Item3"]

Q.12 How to redirect a url using JavaScript?
 window.location = "";

Q.13 What are JavaScript Data Types?
 See this:

Q.14 What is the use of blur function?
  If we use the blur method for the active element, then it loses the active state.

Q.15 What is the purpose of ‘this’ operator in JavaScript?
 When a function is called as a property on a parent object, this refers to the parent object inside that function.

                                         Javascript tricky interview questions

Q.16 Explain what is pop()method in JavaScript?
 See this:

Q.17 How generic objects can be created?
 See this:

Q.18 What are Screen objects?
 See this:

Q.19 What are the different types of errors in JavaScript?
 See this:

Q.20 What are the advantages of using JavaScript?

1.Easy to learn.
2.It execute on client's browser,so eliminate server side processing.
3.It execute on any OS.
4.JavaScript can be used with any type of web page e.g. PHP,ASP.NET,Perl etc.
5.Performance of web page increases due to client side execution.