Nothing Special   »   [go: up one dir, main page]

Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

JavaScript Interview Questions You'll Most Likely Be Asked
JavaScript Interview Questions You'll Most Likely Be Asked
JavaScript Interview Questions You'll Most Likely Be Asked
Ebook143 pages1 hour

JavaScript Interview Questions You'll Most Likely Be Asked

Rating: 0 out of 5 stars

()

Read preview

About this ebook

  • 264 JavaScript Interview Questions
  • 77 HR Interview Questions 
  • Real life scenario based questions
  • Strategies to respond to interview questions
  • 2 Aptitude Tests

JavaScript Interview Quest

LanguageEnglish
Release dateNov 17, 2017
ISBN9781946383877
JavaScript Interview Questions You'll Most Likely Be Asked

Read more from Vibrant Publishers

Related to JavaScript Interview Questions You'll Most Likely Be Asked

Titles in the series (33)

View More

Related ebooks

Programming For You

View More

Related articles

Reviews for JavaScript Interview Questions You'll Most Likely Be Asked

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    JavaScript Interview Questions You'll Most Likely Be Asked - Vibrant Publishers

    JavaScript

    Interview Questions

    You'll Most Likely Be Asked

    Job Interview Questions Series

    www.vibrantpublishers.com

    *****

    JavaScript Interview Questions You'll Most Likely Be Asked

    Copyright 2021, By Vibrant Publishers, USA. All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior permission of the publisher.

    This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. The author has made every effort in the preparation of this book to ensure the accuracy of the information. However, information in this book is sold without warranty either expressed or implied. The Author or the Publisher will not be liable for any damages caused or alleged to be caused either directly or indirectly by this book.

    Vibrant Publishers books are available at special quantity discount for sales promotions, or for use in corporate training programs. For more information please write to bulkorders@vibrantpublishers.com

    Please email feedback / corrections (technical, grammatical or spelling) to spellerrors@vibrantpublishers.com

    To access the complete catalogue of Vibrant Publishers, visit www.vibrantpublishers.com

    *****

    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. JavaScript Design Patterns

    HR Questions Interview

    INDEX

    Introduction to JavaScript

    1: What is JavaScript?

    Answer:

    JavaScript is a scripting language that adds interactivity to HTML pages.

    2: What kind of language does JavaScript provide?

    Answer:

    JavaScript is an interpreted language that executes scripts without preliminary compilation.

    3: Is there any connection between Java and JavaScript?

    Answer:

    No. They are different in every way and JavaScript is not as powerful and complex as Java.

    4: What is the official name of JavaScript and is it supported by all browsers?

    Answer:

    The official name of JavaScript is ECMA (European Computer Manufacturer's Association) and with it, Internet Explorer 4 and Mozilla Firefox 1.5 fully supported.

    5: What does JavaScript do?

    Answer:

    JavaScript is meant to be an easy scripting language that helps the non-programmers with its simple syntax. JavaScript is smart enough that it can put dynamic text into HTML pages, it can react to events (like when a page has finished downloading), and it can read and write HTML elements, create cookies and so forth.

    6: Does prior knowledge of JAVA ease the use of JavaScript?

    Answer:

    Yes. Being modeled after Java, which in turn is modeled after C++, JavaScript should be easier to familiarize and work with.

    7: Is JavaScript case sensitive?

    Answer:

    Yes. Unlike HTML, JavaScript has to have all variables and function names (etc.) in capital letters.

    8: How do you place JavaScript?

    Answer:

    JavaScript may be inserted into code with the following syntax:

    9: Where do you place JavaScript?

    Answer:

    JavaScript may be placed in the or section of HTML code, but it is usually a good practice to place it in as to not hinder your code later on.

    *****

    Statements, Comments and Variables

    10: How do you terminate statements in JavaScript?

    Answer:

    In JavaScript, statements are terminated by semicolons (;) and although they are not mandatory they are a good practice to pick up.

    11: Why are comments used in JavaScript and how are they inserted?

    Answer:

    Usually comments are added to make the code more readable but they can also be used to explain the code. They are inserted with // (for single line comments) and /* */ for multiple lines comments.

    12: What are variables and how are they inserted?

    Answer:

    Variables are storing containers used for holding expressions and values. They can have a short letter or a longer name and are inserted with the statement: var. Because the variables are loosely typed, they can hold any type of data.

    13: What does a variable of var y=10; and var catname= Tomcat; do?

    Answer:

    With the execution of the above code, we have variables that hold values of 10(for y) and Tomcat (for catname).

    Note that the inclusion of text warrants being used.

    14: How many statements types can we find in JavaScript? Give some examples?

    Answer:

    The statement types found in JavaScript are: Expression statements, compound, empty and labeled statements.

    Example: break, continue, default, do, for, etc.

    15: What are conditional statements and how are they implemented in JavaScript?

    Answer:

    Conditional statements are used to perform and act on different sets of conditions declared by the programmer. They are the following: if statement; if...else statement; if...else if...else statement and the switch statement.

    16: How will you determine a variable type in JavaScript?

    Answer:

    A variable type in JavaScript is determined using Typeof operator. When the object is String, Number, Function, undefined and Boolean, the operator returns the same type. And when the object is null and array, the operator returns object.

    Example:

    var count=100;

    typeof count; tmp_e1f79034ec39a99264ca0a2d5bb4c255_A59o_l_html_m34f49bfe.jpg (returns number)

    17: What is the difference in evaluating [8+5+2] and [8+5+2]?

    Answer:

    In [8+5+2],8 is a String. So anything that trail the string will be changed to string. Hence the result will be852.

    In [8+5+2], 8 and 5 are integer, so it gets added up (13).And 2 is treated as String. Hence the concatenation takes place and the result will be 132.

    18: Is it possible to assign a string to a floating point variable?

    Answer:

    Yes. Any variable can be assigned to another data type. For example,

    var a1=10.39;

    document.write(a1); tmp_e1f79034ec39a99264ca0a2d5bb4c255_A59o_l_html_m34f49bfe.jpg 10.39

    a1=hai;

    document.write(a1); tmp_e1f79034ec39a99264ca0a2d5bb4c255_A59o_l_html_m34f49bfe.jpg hai

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

    Answer:

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

    Example:

    var status=cool;

    document.write(status); //cool

    var status;

    document.write(status); //cool

    status=chill;

    document.write(status); //chill

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

    Answer:

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

    Example:

    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?

    Answer:

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

    Example:

    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?

    Answer:

    ^ symbol is used for position matching.

    Example:

    var p1=First_Regular_ Expression_First;

    var q1=/First/^;

    document.write(Pattern_Match: + p1.match(q1)); //Pattern_Match:First tmp_e1f79034ec39a99264ca0a2d5bb4c255_A59o_l_html_m34f49bfe.jpg First_Regular

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

    Answer:

    $ symbol is used for end position matching.

    Example:

    var p1=First_Regular_ Expression_First;

    var q1=/First/$;

    document.write(Pattern_Match: + p1.match(q1)); //Pattern_Match:First tmp_e1f79034ec39a99264ca0a2d5bb4c255_A59o_l_html_m34f49bfe.jpg Expression_First

    *****

    Operators and Functions

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

    Answer:

    Operators in JavaScript are used to combine

    Enjoying the preview?
    Page 1 of 1