Javascript Assessment Test
By Edward Yao
()
About this ebook
The Javascript Assessment Test (85 questions)
Time limit: 45 minutes (All answers found at end of book)
Select the best answer for each question.
1. The statement below creates a new context.
eval?.("'use strict'; function f(){console.log('hello')}")
a. true
b. false
2. Under non-strict mode, a statement x = 40 performs what action?
a. variable declaration
b. variable assignment
c. variable declaration or assignment
d. variable declaration and assignment
e. none of the above
3. What best describes the type of relationship between the variable named i and the anonymous function in the code below:
var a = [];
for (var i=0; i<5; ++i){
a[i] = function(){
console.log(i);
}
}
a. one-to-one
b. one-to-many
c. many-to-one
d. many-to-many
e. none of the above
4. Which of the options below would solve the script error?
function f(){
this.msg = "hello"
}
f.prototype.greet = function(name){
console.log(`${this.msg}, ${name}`)
} }
const obj = new f()
setTimeout(obj.greet, 1000, "world!")
a. iteration or recursion
b. block or constant variable
c. function wrapper or reference
d. call or apply method
e. none of the above
5. The var keyword creates properties on the window object.
a. true
b. false
6. Every object instance has a prototype property.
a. true
b. false
7. The strict mode is automatically in effect for a given script.
a. true
b. false
8. Using the let keyword creates properties on the global object.
a. true
b. false
9. How many closures or contexts are created in the given script?
var list = [];
f();
list.forEach(fn=>fn());
function f(){
var strings = ["romeo", "sierra", "tango"];
for (let i = 0; i < 3; i++){
list[i] = ()=>console.log(list[i], strings[i]);
}
}
a. 5
b. 9
c. 11
d. 7
e. none of the above
10. Every object instance has a __prototype__ property.
a. true
b. false
11. The formal argument of the given dynamic function forms a closure with the custom Date() function.
(function(){
function Date(){
console.log(“Have a happy date!”);
}
new Function(“Date”, "return Date()")(Date);
})();
a. true
b. false
12. How many variables exist while the function f is running?
var x = 0;
var y = 1;
function f() {
var x = y;
}
f();
a. 2
b. 3
c. 5
d. 4
e. none of the above
Related to Javascript Assessment Test
Related ebooks
Job Ready Go Rating: 0 out of 5 stars0 ratingsLearn Angular: Build a Todo App Rating: 0 out of 5 stars0 ratingsJavascript Concepts: 1St Edition Rating: 0 out of 5 stars0 ratingsJavaScript Interview Questions You'll Most Likely Be Asked: Job Interview Questions Series Rating: 0 out of 5 stars0 ratingsIntroduction to PHP, Part 4, Second Edition Rating: 0 out of 5 stars0 ratingsUnleashing the Power of TypeScript Rating: 0 out of 5 stars0 ratingsJavascript - 50 functions and tutorial Rating: 0 out of 5 stars0 ratingsPHP Package Mastery: 100 Essential Tools in One Hour - 2024 Edition Rating: 0 out of 5 stars0 ratingsMicrosoft AJAX Library Essentials: Client-side ASP.NET AJAX 1.0 Explained Rating: 0 out of 5 stars0 ratingsVisual Studio Code for Python Programmers Rating: 0 out of 5 stars0 ratingsProgressive web app A Clear and Concise Reference Rating: 0 out of 5 stars0 ratingsBeginning DotNetNuke Skinning and Design Rating: 0 out of 5 stars0 ratingsPhpStorm Cookbook Rating: 0 out of 5 stars0 ratingsASP.NET AJAX The Ultimate Step-By-Step Guide Rating: 0 out of 5 stars0 ratingsjQuery Mobile Web Development Essentials - Third Edition Rating: 0 out of 5 stars0 ratingsNW.js Essentials Rating: 0 out of 5 stars0 ratingsSoftware architecture A Complete Guide - 2019 Edition Rating: 0 out of 5 stars0 ratingsPro Spring Boot 2: An Authoritative Guide to Building Microservices, Web and Enterprise Applications, and Best Practices Rating: 0 out of 5 stars0 ratingsAjax Bible Rating: 3 out of 5 stars3/5Progressive Web Apps Standard Requirements Rating: 0 out of 5 stars0 ratingsInstant Jsoup How-to Rating: 0 out of 5 stars0 ratingsStart Concurrent: An Introduction to Problem Solving in Java with a Focus on Concurrency, 2014 Rating: 0 out of 5 stars0 ratingsAlfresco 3 Cookbook Rating: 0 out of 5 stars0 ratingsFlutter Recipes: Mobile Development Solutions for iOS and Android Rating: 0 out of 5 stars0 ratingsAJAX Interview Questions, Answers, and Explanations: AJAX Certification Review Rating: 0 out of 5 stars0 ratingsASP.NET 3.5 Application Architecture and Design Rating: 0 out of 5 stars0 ratingsLearn PHP 8: Using MySQL, JavaScript, CSS3, and HTML5 Rating: 0 out of 5 stars0 ratingsJump Start PHP Environment: Master the World's Most Popular Language Rating: 0 out of 5 stars0 ratingsUNIX Programming: UNIX Processes, Memory Management, Process Communication, Networking, and Shell Scripting Rating: 0 out of 5 stars0 ratings
Programming For You
Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Game Development with Unreal Engine 5: Learn the Basics of Game Development in Unreal Engine 5 (English Edition) Rating: 0 out of 5 stars0 ratingsExcel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5C# Programming from Zero to Proficiency (Beginner): C# from Zero to Proficiency, #2 Rating: 0 out of 5 stars0 ratingsPython Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Learn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5Python QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsPYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Problem Solving in C and Python: Programming Exercises and Solutions, Part 1 Rating: 5 out of 5 stars5/5Python Data Structures and Algorithms Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5The Unofficial Guide to Open Broadcaster Software: OBS: The World's Most Popular Free Live-Streaming Application Rating: 0 out of 5 stars0 ratingsPython GUI Programming Cookbook - Second Edition Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5
Reviews for Javascript Assessment Test
0 ratings0 reviews
Book preview
Javascript Assessment Test - Edward Yao
Copyright
1st Edition
Copyright © 2022 EYPub
All rights reserved.
ISBN: 978-1-387-60075-5
The Javascript Assessment Test
Time limit: 45 minutes (All answers found at end of book)
Passing score: 85%
Select the best answer for each question.
1. An object instantiated from a function Box(){} constructor would have how many prototypes in its inheritance chain?
a. 0
b. 1
c. 2
d. 3
e. none of the above
2. The var keyword creates properties on the window object.
a. true
b. false
3. How many closures are created in the below script?
var list = [];
f();
list.forEach(fn=>fn());
function f(){
var strings = [romeo
, sierra
, tango
];
for (let i = 0; i < 3; i++){
list[i] = ()=>console.log(list[i], strings[i]);
}
}
a. 3
b. 9
c. 5
d. 7
e.