JavaScript Interview Questions You'll Most Likely Be Asked

Price: $19.95
Sale: $16.36
Save: 18% off



JavaScript Interview Questions You'll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today's competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver's seat and helps them steer their way to impress the interviewer.


Table of Contents

1. Introduction to JavaScript
2. Statements, Comments and Variables
3. Operators and Functions
4. Values, Arrays and Operators
5. Modules, Characters and Attributes
6. Event Handlers and DOM
7. Keywords, CSS and CSS2
8. Statements and Functions
9. Roles of JavaScript, Scripts and Events
10. Opening and Manipulating Windows
11. Objects and their Properties in JavaScript
12. JavaScript and HTML
13. JavaScript Forms
14. JavaScript Constructors
15. Miscellaneous Arguments, Functions and Methods in JavaScript
16. HR Questions



a) 250 JavaScript Interview Questions, Answers and Proven Strategies for getting hired as an IT professional

b) Dozens of examples to respond to interview questions

c) 51 HR Questions with Answers and Proven strategies to give specific, impressive, answers that help nail the interviews

d) 2 Aptitude Tests download available



Sample from the book
(Below Questions and Answers are randomly taken from different pages of the book)

19: Will variable redeclaration affect the value of that variable?


No. The same value will be retained in the variable.


var status=”cool”;

document.write(“status”); //cool

var status;

document.write(“status”); //cool


document.write(“status”); //chill


20: How will you search a matching pattern globally in a string?


A matching pattern can be globally searched in a string using “g” modifier in Regular Expression.


var p1=”First_Regular_ Expression_First”;

var q1=”/First/g”;

document.write(“Pattern_Match:” + p1.match(q1)); // Pattern_Match:First,First


21: How will you search a particular pattern in a string?


A particular pattern in string can be searched using test function. If the match is found it returns true, else false.


var my_pattern1=new RegExp(“pp”);

document.write(my_pattern1.test(“Happy_Days”); //true


22: Which property is used to match the pattern at the start of the string?


“^” symbol is used for position matching.


var p1=”First_Regular_ Expression_First”;

var q1=”/First/^”;

document.write(“Pattern_Match:” + p1.match(q1)); //Pattern_Match:First -> First_Regular


23: Which property is used to match the pattern at the end of the string?


“$” symbol is used for end position matching.


var p1=”First_Regular_ Expression_First”;

var q1=”/First/$”;

document.write(“Pattern_Match:” + p1.match(q1)); //Pattern_Match:First -> Expression_First


24: What are operators? Which are the most important operators in JavaScript?


Operators in JavaScript are used to combine values that form expressions. The most important are: = and +. The first is used to assign values and the second one is used to add values together.


25: Why comparison and logical operators are used?


Comparison operators are used to determine if there is a difference between variables, and also their equality, while the logical operators are used to determine the logic of variables.


26: How many types of pop-up boxes does JavaScript have? What are those?


JavaScript has three types of pop-up boxes and they are: alert, confirm and prompt.


27: Does creating an alert box prompt the user to respond with OK or Cancel?


No. An alert box only gives the user the option of choosing OK to proceed.


28: What are functions in JavaScript and where are they placed?


Functions contain code that is executed before an event thus stopping the browser from loading a script when the page opens. Functions can be placed both in the <head> or <body> section, but it is advised to place them in the <head> section.


175: What does the “new” operator do?


The “new” operator creates a new object, that has no properties, and then it invokes the function passing the new objected created as the value of “this” keyword. The function that uses the “new” operator is called “constructor function” or just simply “constructor”.


176: What does <optgroup> tag do in JavaScript?


It is used with select statement to group the related options in the drop down list. It will be useful to display long list



<optgroup label=”JAVA”>

<option value=”hibernate1”>Hibernate</option>

<option value=”struts1”> Struts </option>


<optgroup label=”WEBSERVICE”>

<option value=”soap1”>SOAP</option>

<option value=”xml1”> Xml </option>




177: Comparison between session state and view state.



188: What does a JavaScript constructor do?


The constructor initializes the newly created object and sets any properties that need to be set before that object is used. You can easily define a constructor function, by writing a function that adds properties to “this” operator.


// define the constructor

function circle(r){

this.radius = r;


//invoke the constructor to create a circle object:

var circle1 = new circle(3); // we pass the radius value to the constructor so that it will initialize the new object appropriately.