Refer to the code below:

What is the output of this function when called with an empty array?
Answer : B
developer uses the code below to format a date.

After executing, what is the value of formattedDate?
Answer : B
At Universal Containers, every team has its own way of copying JavaScript objects. The
code
Snippet shows an implementation from one team:
Function Person() {
this.firstName = ''John'';
this.lastName = 'Doe';
This.name =() => (
console.log('Hello $(this.firstName) $(this.firstName)');
)}
Const john = new Person ();
Const dan = JSON.parse(JSON.stringify(john));
dan.firstName ='Dan';
dan.name();
What is the Output of the code execution?
Answer : C
A developer is debugging a web server that uses Node.js The server hits a runtimeerror
every third request to an important endpoint on the web server.
The developer added a break point to the start script, that is at index.js at he root of the
server's source code. The developer wants to make use of chrome DevTools to debug.
Which command can be run to access DevTools and make sure the breakdown is hit ?
Answer : D
There is a new requirement for a developer to implement a currPrice method that will return the current price of the item or sales..

What is the output when executing the code above
Answer : B
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++){
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of the array after the code executes?
Answer : C
The developer wants to test this code:
Const toNumber =(strOrNum) => strOrNum;
Which two tests are most accurate for this code?
Choose 2 answers
Answer : A, C
Refer to the following code that imports a module named utils:
import (foo, bar) from '/path/Utils.js';
foo() ;
bar() ;
Which two implementations of Utils.js export foo and bar such that the code above runs without
error?
Choose 2 answers
Answer : B, C
Which javascript methods can be used to serialize an object into a string and deserialize
a JSON string into an object, respectively?
Answer : A
Consider type coercion, what does the following expression evaluate to?
True + 3 + '100' + null
Answer : D
A developer has two ways to write a function:
Option A:
function Monster() {
This.growl = () => {
Console.log (''Grr!'');
}
}
Option B:
function Monster() {};
Monster.prototype.growl =() => {
console.log(''Grr!'');
}
After deciding on an option, the developer creates 1000 monster objects.
How many growl methods are created with Option A Option B?
Answer : B
Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
The developer needs to insert a code statement in the location shown. The code
statement has these requirements:
1. Does require an import
2. Logs an error when the boolean statement evaluates to false
3. Works in both the browser and Node.js
Which meet the requirements?
Answer : B
Refer to the code below:
const event = new CustomEvent(
//Missing Code
);
obj.dispatchEvent(event);
A developer needs to dispatch a custom event called update to send information about
recordId.
Which two options could a developer insert at the placeholder in line 02 to achieve this?
Choose 2 answers
Answer : A, D
A developer wants to use a try...catch statement to catch any error that countSheep () may throw and pass it to a handleError () function.
What is the correct implementation of the try...catch?
A)

B)

C)

D)

Answer : A
Refer to the code below:
let timeFunction =() => {
console.log('Timer called.'');
};
let timerId = setTimeout (timedFunction, 1000);
Which statement allows a developer to cancel the scheduled timed function?
Answer : C
A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below:
Import printPrice from '/path/PricePrettyPrint.js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for this import to work ?
Answer : C
Refer to the code below:

Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?
Answer : B
Refer to the code below:
let sayHello = () => {
console.log ('Hello, world!');
};
Which code executes sayHello once, two minutes from now?
Answer : A
Universal Containers recently launched its new landing page to host a crowd-funding
campaign. The page uses an external library to display some third-party ads. Once the page is
fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the
one in the code below:

All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
Answer : C
Refer to the following code:

What is the output of line 11?
Answer : D
Given the code below:
const copy = JSON.stringify([ new String(' false '), new Bollean( false ), undefined ]);
What is the value of copy?
Answer : D
Which option is a core Node,js module?
Answer : A
Consider type coercion, what does the following expression evaluate to?
True + 3 + '100' + null
Answer : D
A developer has the following array of student test grades:
Let arr = [ 7, 8, 5, 8, 9 ];
The Teacher wants to double each score and then see an array of the students
who scored more than 15 points.
How should the developer implement the request?
Answer : C
Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
The developer needs to insert a code statement in the location shown. The code
statement has these requirements:
1. Does require an import
2. Logs an error when the boolean statement evaluates to false
3. Works in both the browser and Node.js
Which meet the requirements?
Answer : B
Universal Container(UC) just launched a new landing page, but users complain that the
website is slow. A developer found some functions that cause this problem. To verify this, the
developer decides to do everything and log the time each of these three suspicious functions
consumes.
console.time('Performance');
maybeAHeavyFunction();
thisCouldTakeTooLong();
orMaybeThisOne();
console.endTime('Performance');
Which function can the developer use to obtain the time spent by every one of the three
functions?
Answer : A
Given the code below:

What is logged to the console'
Answer : D
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log('"LOG:', logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use?
Choose 2 answers
Answer : A, C
developer removes the HTML class attribute from the checkout button, so now it is
simply:
.
There is a test to verify the existence of the checkout button, however it looks for a button with
class= ''blue''. The test fails because no such button is found.
Which type of test category describes this test?
Answer : D
Refer to the code below:
Async funct on functionUnderTest(isOK) {
If (isOK) return 'OK' ;
Throw new Error('not OK');
)
Which assertion accurately tests the above code?
Answer : D
Refer to the code below:
Let foodMenu1 = ['pizza', 'burger', 'French fries'];
Let finalMenu = foodMenu1;
finalMenu.push('Garlic bread');
What is the value of foodMenu1 after the code executes?
Answer : B
Refer to code below:
Function muFunction(reassign){
Let x = 1;
var y = 1;
if( reassign ) {
Let x= 2;
Var y = 2;
console.log(x);
console.log(y);}
console.log(x);
console.log(y);}
What is displayed when myFunction(true) is called?
Answer : C
Refer to the code:

Given the code above, which three properties are set pet1?
Choose 3 answers:
Answer : B, C, E
Refer to code below:
Let a ='a';
Let b;
// b = a;
console.log(b);
What is displayed when the code executes?
Answer : C
Which three browser specific APIs are available for developers to persist data between page loads ?
Choose 3 answers
Answer : A, B, E
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++){
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of the array after the code executes?
Answer : C
Refer to the following code that performs a basic mathematical operation on a provided
input:
function calculate(num) {
Return (num +10) / 3;
}
How should line 02 be written to ensure that x evaluates to 6 in the line below?
Let x = calculate (8);
Answer : B
Refer to code below:
Const objBook = {
Title: 'Javascript',
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = 'Robert';
What are the values of objBook and newObjBook respectively ?
Answer : A
Refer to the code below:

What is the value of result after line 10 executes?
Answer : B
Given the requirement to refactor the code above to JavaScript class format, which class
definition is correct?

A)

B)

C)

D)

Answer : A
A developer has an ErrorHandler module that contains multiple functions.
What kind of export should be leveraged so that multiple functions can be used?
Answer : B
A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.
The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server, js file will start the server. the developer wants to debug the Node.js server only using the terminal.
Which command can the developer use to open the CLI debugger in their current terminal window?
Answer : B
Which statement phrases successfully?
Answer : D
A developer wants to use a module named universalContainersLib and then call functions from it.
How should a developer import every function from the module and then call the functions foo and bar?
Answer : D
Refer to the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction);
resolve(fraction);
})
.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() => console.log(" when am I called?"));

When does Promise.finally on line 08 get called?
Answer : D
Refer to the code below:
Function changeValue(obj) {
Obj.value = obj.value/2;
}
Const objA = (value: 10);
Const objB = objA;
changeValue(objB);
Const result = objA.value;
What is the value of result after the code executes?
Answer : C
Refer to the following code:
Let sampleText = 'The quick brown fox jumps';
A developer needs to determine if a certain substring is part of a string.
Which three expressions return true for the given substring ?
Choose 3 answers
Answer : B, D, E
Which code statement below correctly persists an objects in local Storage ?
Answer : A
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
Answer : C
A developer creates a class that represents a blog post based on the requirement that a
Post should have a body author and view count.
The Code shown Below:
Class Post {
// Insert code here
This.body =body
This.author = author;
this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set
to a new instanceof a Post with the three attributes correctly populated?
Answer : C
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.

Which two results occur when running this test on the updated sum3 function?
Choose 2 answers
Answer : B, D
A developer receives a comment from the Tech Lead that the code given below has
error:
const monthName = 'July';
const year = 2019;
if(year === 2019) {
monthName = 'June';
}
Which line edit should be made to make this code run?
Answer : A
A developer wants to create an object from a function in the browser using the code below.

What happens due to the lack of the mm keyword on line 02?
Answer : A
Refer to the code below:
Let textValue = '1984';
Which code assignment shows a correct way to convert this string to an integer?
Answer : A
Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?
Choose 3 answers
Answer : A, C, E
In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default.
Which two methods are used to address this ?
Choose 2 answers
Answer : B
A developer is working on an ecommerce website where the delivery date is dynamically
calculated based on the current day. The code line below is responsible for this calculation.
Const deliveryDate = new Date ();
Due to changes in the business requirements, the delivery date must now be today's
date + 9 days.
Which code meets this new requirement?
Answer : A
There is a new requirement for a developer to implement a currPrice method that will return the current price of the item or sales..

What is the output when executing the code above
Answer : B
Refer to the following code:

Which two statement could be inserted at line 17 to enable the function call on line 18?
Choose 2 answers
Answer : A, C
A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below:
Import printPrice from '/path/PricePrettyPrint.js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for this import to work ?
Answer : C
Refer to HTML below:
The current status of an Order: In Progress
.Which JavaScript statement changes the text 'In Progress' to 'Completed' ?
Answer : C
Refer to following code:
class Vehicle {
constructor(plate) {
This.plate =plate;
}
}
Class Truck extends Vehicle {
constructor(plate, weight) {
//Missing code
This.weight = weight;
}
displayWeight() {
console.log('The truck ${this.plate} has a weight of ${this.weight} lb.');}}
Let myTruck = new Truck('123AB', 5000);
myTruck.displayWeight();
Which statement should be added to line 09 for the code to display 'The truck 123AB has a
weight of 5000lb.'?
Answer : B
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
Will establish a web socket connection and handle receipt of messages to the server
Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
Answer : C
A class was written to represent items for purchase in an online store, and a second class
Representing items that are on sale at a discounted price. THe constructor sets the name to the
first value passed in. The pseudocode is below:
Class Item {
constructor(name, price) {
... // Constructor Implementation
}
}
Class SaleItem extends Item {
constructor (name, price, discount) {
...//Constructor Implementation
}
}
There is a new requirement for a developer to implement a description method that will return a
brief description for Item and SaleItem.
Let regItem =new Item('Scarf', 55);
Let saleItem = new SaleItem('Shirt' 80, -1);
Item.prototype.description = function () { return 'This is a ' + this.name;
console.log(regItem.description());
console.log(saleItem.description());
SaleItem.prototype.description = function () { return 'This is a discounted ' +
this.name; }
console.log(regItem.description());
console.log(saleItem.description());
What is the output when executing the code above ?
Answer : B
A developer is setting up a Node,js server and is creating a script at the root of the source code, index,js, that will start the server when executed. The developer declares a variable that needs the folder location that the code executes from.
Which global variable can be used in the script?
Answer : B
Refer to code below:
Const objBook = {
Title: 'Javascript',
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = 'Robert';
What are the values of objBook and newObjBook respectively ?
Answer : A
A developer creates a generic function to log custom messages in the console. To do this,
the function below is implemented.
01 function logStatus(status){
02 console./*Answer goes here*/{'Item status is: %s', status};
03 }
Which three console logging methods allow the use of string substitution in line 02?
Answer : B, D, E
Refer to the following object:
const cat ={
firstName: 'Fancy',
lastName: ' Whiskers',
Get fullName() {
return this.firstName + ' ' + this.lastName;
}
};
How can a developer access the fullName property for cat?
Answer : A
Refer to the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction);
resolve(fraction);
})
.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() => console.log(" when am I called?"));

When does Promise.finally on line 08 get called?
Answer : D
A developer has the following array of hourly wages:
Let arr = (8, 5, 9, 75, 11, 25, 7, 75, , 13, 25);
For workers making less than $10 an hour rate should be multiple by 1.25 and returned in a new array.
How should the developer implement the request?
Answer : C
A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.
The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server, js file will start the server. the developer wants to debug the Node.js server only using the terminal.
Which command can the developer use to open the CLI debugger in their current terminal window?
Answer : B
Refer to the code below:
Function Person(firstName, lastName, eyecolor) {
this.firstName =firstName;
this.lastName = lastName;
this.eyeColor = eyeColor;
}
Person.job = 'Developer';
const myFather = new Person('John', 'Doe');
console.log(myFather.job);
What is the output after the code executes?
Answer : D
A developer is wondering whether to use, Promise.then or Promise.catch, especially
when a Promise throws an error?
Which two promises are rejected?
Which 2 are correct?
Answer : B, C
Teams at Universal Containers (UC) work on multiple JavaScript projects at the same time.
UC is thinking about reusability and how each team can benefit from the work of others.
Going open-source or public is not an option at this time.
Which option is available to UC with npm?
Answer : A
Refer to the following array:
Let arr1 = [ 1, 2, 3, 4, 5 ];

Which two lines of code result in a second array, arr2 being created such that arr2 is not
a reference to arr1?
Answer : A, B
Refer to the code below:
Let str = 'javascript';
Str[0] = 'J';
Str[4] = 'S';
After changing the string index values, the value of str is 'javascript'. What is the reason
for this value:
Answer : D
Refer to code below:
Let productSKU = '8675309' ;
A developer has a requirement to generate SKU numbers that are always 19 characters lon,
starting with 'sku', and padded with zeros.
Which statement assigns the values sku0000000008675309 ?
Answer : D
Given the following code:

What will be the first four numbers logged?
Answer : B
Refer to the code snippet:
Function getAvailabilityMessage(item) {
If (getAvailability(item)){
Var msg =''Username available'';
}
Return msg;
}
A developer writes this code to return a message to user attempting to register a new
username. If the username is available, variable.
What is the return value of msg hen getAvailabilityMessage (''newUserName'' ) is
executed and getAvailability(''newUserName'') returns false?
Answer : D
Which option is true about the strict mode in imported modules?
Answer : B
A developer has the function, shown below, that is called when a page loads.
function onload() {
console.log(''Page has loaded!'');
}
Where can the developer see the log statement after loading the page in the browser?
Answer : C
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++){
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of the array after the code executes?
Answer : C
Which statement phrases successfully?
Answer : D
Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions any that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
Which function can the developer use to obtain the time spent by every one of the three functions?

Answer : A
A developer initiates a server with the file server,js and adds dependencies in the source codes package,json that are required to run the server.
Which command should the developer run to start the server locally?
Answer : C
Given the code below:
Function myFunction(){
A =5;
Var b =1;
}
myFunction();
console.log(a);
console.log(b);
What is the expected output?
Answer : B
developer publishes a new version of a package with new features that do not break
backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number
be?
Answer : D
Refer to the following code:

Which two statement could be inserted at line 17 to enable the function call on line 18?
Choose 2 answers
Answer : A, C
A developer creates a simple webpage with an input field. When a user enters text in the input field and clicks the button, the actual value of the field must be displayed in the console.
Here is the HTML file content:
The developer wrote the javascript code below:
Const button = document.querySelector('button');
button.addEvenListener('click', () => (
Const input = document.querySelector('input');
console.log(input.getAttribute('value'));
When the user clicks the button, the output is always ''Hello''.
What needs to be done to make this code work as expected?
Answer : A
A developer implements and calls the following code when an application state change occurs:
Const onStateChange =innerPageState) => {
window.history.pushState(newPageState, ' ', null);
}
If the back button is clicked after this method is executed, what can a developer expect?
Answer : B
A developer is leading the creation of a new web server for their team that will fulfill API requests from an existing client.
The team wants a web server that runs on Node.Js, and they want to use the new web framework Minimalist.Js. The lead developer wants to advocate for a more seasoned back-end framework that already has a community around it.
Which two frameworks could the lead developer advocate for?
Choose 2 answers
Answer : B, C
A developer wants to iterate through an array of objects and count the objects and count
the objects whose property value, name, starts with the letter N.
Const arrObj = [{''name'' : ''Zach''} , {''name'' : ''Kate''},{''name'' : ''Alise''},{''name'' : ''Bob''},{''name'' :
''Natham''},{''name'' : ''nathaniel''}
Refer to the code snippet below:
01 arrObj.reduce(( acc, curr) => {
02 //missing line 02
02 //missing line 03
04 ). 0);
Which missing lines 02 and 03 return the correct count?
Answer : B
The developer wants to test this code:
Const toNumber =(strOrNum) => strOrNum;
Which two tests are most accurate for this code?
Choose 2 answers
Answer : A, C
A developer implements a function that adds a few values.
Function sum(num) {
If (num == undefined) {
Num =0;
}
Return function( num2, num3){
If (num3 === undefined) {
Num3 =0 ;
}
Return num + num2 + num3;
}
}
Which three options can the developer invoke for this function to get a return value of 10 ?
Choose 3 answers
Answer : C, D
Refer to the following code:

What is the value of output on line 11?
Answer : D
Given the code below:
01 function GameConsole (name) {
02 this.name = name;
03 }
04
05 GameConsole.prototype.load = function(gamename) {
06 console.log( ` $(this.name) is loading a game : $(gamename) ...`);
07 )
08 function Console 16 Bit (name) {
09 GameConsole.call(this, name) ;
10 }
11 Console16bit.prototype = Object.create ( GameConsole.prototype) ;
12 //insert code here
13 console.log( ` $(this.name) is loading a cartridge game : $(gamename) ...`);
14 }
15 const console16bit = new Console16bit(' SNEGeneziz ');
16 console16bit.load(' Super Nonic 3x Force ');
What should a developer insert at line 15 to output the following message using the
method ?
> SNEGeneziz is loading a cartridge game: Super Monic 3x Force . . .
Answer : B
A developer is creating a simple webpage with a button. When a user clicks this button
for the first time, a message is displayed.
The developer wrote the JavaScript code below, but something is missing. The
message gets displayed every time a user clicks the button, instead of just the first time.
01 function listen(event) {
02 alert ( 'Hey! I am John Doe') ;
03 button.addEventListener ('click', listen);
Which two code lines make this code work as required?
Choose 2 answers
Answer : C, D
A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below:
Import printPrice from '/path/PricePrettyPrint.js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for this import to work ?
Answer : C
Which code change should be done for the console to log the following when 'Click me!' is clicked'
> Row log
> Table log
Answer : B
Given the code below:
const copy = JSON.stringify([ new String(' false '), new Bollean( false ), undefined ]);
What is the value of copy?
Answer : D
Refer to the code below:
Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5] ?
Choose 2 answers
Answer : A, B
Which code statement correctly retrieves and returns an object from localStorage?
Answer : C
A developer initiates a server with the file server,js and adds dependencies in the source codes package,json that are required to run the server.
Which command should the developer run to start the server locally?
Answer : C
Refer to the code below:
Let str = 'javascript';
Str[0] = 'J';
Str[4] = 'S';
After changing the string index values, the value of str is 'javascript'. What is the reason
for this value:
Answer : D
A developer wants to create an object from a function in the browser using the code below.

What happens due to the lack of the mm keyword on line 02?
Answer : A
Refer to the code below?
Let searchString = ' look for this ';
Which two options remove the whitespace from the beginning of searchString?
Choose 2 answers
Answer : B, D
A developer implements a function that adds a few values.
Function sum(num) {
If (num == undefined) {
Num =0;
}
Return function( num2, num3){
If (num3 === undefined) {
Num3 =0 ;
}
Return num + num2 + num3;
}
}
Which three options can the developer invoke for this function to get a return value of 10 ?
Choose 3 answers
Answer : C, D
Refer to the following array:
Let arr = [ 1,2, 3, 4, 5];
Which three options result in x evaluating as [3, 4, 5] ?
Choose 3 answers.
Answer : B, C, D
A Developer wrote the following code to test a sum3 function that takes in an array of
numbers and returns the sum of the first three number in the array, The test passes:
Let res = sum2([1, 2, 3 ]) ;
console.assert(res === 6 );
Res = sum3([ 1, 2, 3, 4]);
console.assert(res=== 6);
A different developer made changes to the behavior of sum3 to instead sum all of the numbers
present in the array. The test passes:
Which two results occur when running the test on the updated sum3 function ?
Choose 2 answers
Answer : A, D
Which code change should be done for the console to log the following when 'Click me!' is clicked'
> Row log
> Table log
Answer : B
Given the following code:
Let x =null;
console.log(typeof x);
What is the output of the line 02?
Answer : C
Refer to code below:
Let first = 'who';
Let second = 'what';
Try{
Try{
Throw new error('Sad trombone');
}catch (err){
First ='Why';
}finally {
Second ='when';
} catch (err) {
Second ='Where';
}
What are the values for first and second once the code executes ?
Answer : D
There is a new requirement for a developer to implement a currPrice method that will return the current price of the item or sales..

What is the output when executing the code above
Answer : B
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
Answer : C
Refer to following code:
class Vehicle {
constructor(plate) {
This.plate =plate;
}
}
Class Truck extends Vehicle {
constructor(plate, weight) {
//Missing code
This.weight = weight;
}
displayWeight() {
console.log('The truck ${this.plate} has a weight of ${this.weight} lb.');}}
Let myTruck = new Truck('123AB', 5000);
myTruck.displayWeight();
Which statement should be added to line 09 for the code to display 'The truck 123AB has a
weight of 5000lb.'?
Answer : B
Universal Containers recently launched its new landing page to host a crowd-funding
campaign. The page uses an external library to display some third-party ads. Once the page is
fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the
one in the code below:

All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
Answer : C
Given the following code:
Let x =null;
console.log(typeof x);
What is the output of the line 02?
Answer : C
Refer to the code below:
let sayHello = () => {
console.log ('Hello, world!');
};
Which code executes sayHello once, two minutes from now?
Answer : A
Refer to the code below:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
Answer : C
In which situation should a developer include a try .. catch block around their function call ?
Answer : C
Refer to the following code that imports a module named utils:
import (foo, bar) from '/path/Utils.js';
foo() ;
bar() ;
Which two implementations of Utils.js export foo and bar such that the code above runs without
error?
Choose 2 answers
Answer : B, C
Refer to the HTML below:
Which JavaScript statement results in changing '' Tony'' to ''Mr. T.''?
Answer : D
Given the code below:
01 function GameConsole (name) {
02 this.name = name;
03 }
04
05 GameConsole.prototype.load = function(gamename) {
06 console.log( ` $(this.name) is loading a game : $(gamename) ...`);
07 )
08 function Console 16 Bit (name) {
09 GameConsole.call(this, name) ;
10 }
11 Console16bit.prototype = Object.create ( GameConsole.prototype) ;
12 //insert code here
13 console.log( ` $(this.name) is loading a cartridge game : $(gamename) ...`);
14 }
15 const console16bit = new Console16bit(' SNEGeneziz ');
16 console16bit.load(' Super Nonic 3x Force ');
What should a developer insert at line 15 to output the following message using the
method ?
> SNEGeneziz is loading a cartridge game: Super Monic 3x Force . . .
Answer : B
Given the code below:
Which three code segments result in a correct conversion from number to string? Choose 3 answers
Answer : A, B, D
Refer to the following object.

How can a developer access the fullName property for dog?
Answer : A
Given HTML below:
Which statement adds the priority = account CSS class to the universal Containers row ?
Answer : B
Refer to the code below:

What is the value of result when the code executes?
Answer : A
A developer receives a comment from the Tech Lead that the code given below has
error:
const monthName = 'July';
const year = 2019;
if(year === 2019) {
monthName = 'June';
}
Which line edit should be made to make this code run?
Answer : A
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
Which statement can a developer apply to increment the browser's navigation history without a page refresh?
Answer : C
developer uses the code below to format a date.

After executing, what is the value of formattedDate?
Answer : B
Which code change should be done for the console to log the following when 'Click me!' is clicked'
> Row log
> Table log
Answer : B
Refer of the string below:
Const str = 'sa;esforce'=;
Which two statement result in the word 'Sale'?
Choose 2 answers
Answer : A, B
Which two console logs output NaN?
Choose 2 answers | |
Answer : A, B
Refer to the code below:

Line 05 causes an error.
What are the values of greeting and salutation once code completes?
Answer : A
Refer to the following code:
function displayMessage(ev) {
ev.stopPropagation();
console.log('Inner message.');
}
const elem = document.getElementById('myButton');
elem.addEventListener('click' , displayMessage);
What will the console show when the button is clicked?
Answer : D
A developer has the function, shown below, that is called when a page loads.
function onload() {
console.log(''Page has loaded!'');
}
Where can the developer see the log statement after loading the page in the browser?
Answer : C
Refer to the code below:
let sayHello = () => {
console.log ('Hello, world!');
};
Which code executes sayHello once, two minutes from now?
Answer : A
Given the code below:
Function myFunction(){
A =5;
Var b =1;
}
myFunction();
console.log(a);
console.log(b);
What is the expected output?
Answer : B
Universal Containers (UC) notices that its application that allows users to search for
accounts makes a network request each time a key is pressed. This results in too many
requests for the server to handle.
Address this problem, UC decides to implement a debounce function on string change
handler.
What are three key steps to implement this debounce function?
Choose 3 answers:
Answer : A, B, C
Which code statement correctly retrieves and returns an object from localStorage?
Answer : C
A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the
function to run once after five seconds.
What is the correct syntax to schedule this function?
Answer : D
Refer to the code snippet:
Function getAvailabilityMessage(item) {
If (getAvailability(item)){
Var msg =''Username available'';
}
Return msg;
}
A developer writes this code to return a message to user attempting to register a new
username. If the username is available, variable.
What is the return value of msg hen getAvailabilityMessage (''newUserName'' ) is
executed and getAvailability(''newUserName'') returns false?
Answer : D
Refer to the code below:
console.log(''start);
Promise.resolve('Success') .then(function(value){
console.log('Success');
});
console.log('End');
What is the output after the code executes successfully?
Answer : C
Refer to the following array:
Let arr1 = [ 1, 2, 3, 4, 5 ];

Which two lines of code result in a second array, arr2 being created such that arr2 is not
a reference to arr1?
Answer : A, B
Refer to the code below:
Let str = 'javascript';
Str[0] = 'J';
Str[4] = 'S';
After changing the string index values, the value of str is 'javascript'. What is the reason
for this value:
Answer : D
Refer to the following code:

Which statement should be added to line 09 for the code to display 'The boat has a capacity of 10 people?
Answer : D
A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method,
Calculator query, that returns an array. The developer does not need to verify how many times the method has been called.
Which two test approaches describe the requirement?
Choose 2 answers
Answer : A, D
Given the following code:

is the output of line 02?
Answer : C
A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
Will establish a web socket connection and handle receipt of messages to the server
Will be imported with require, and made available with a variable called we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
Answer : C
Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions any that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
Which function can the developer use to obtain the time spent by every one of the three functions?

Answer : A
Refer to following code block:
Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];
Let output =0;
For (let num of array){
if (output >0){
Break;
}
if(num % 2 == 0){
Continue;
}
Output +=num;
What is the value of output after the code executes?
Answer : A
A developer creates a generic function to log custom messages in the console. To do this,
the function below is implemented.
01 function logStatus(status){
02 console./*Answer goes here*/{'Item status is: %s', status};
03 }
Which three console logging methods allow the use of string substitution in line 02?
Answer : B, D, E
A developer is leading the creation of a new web server for their team that will fulfill API requests from an existing client.
The team wants a web server that runs on Node.Js, and they want to use the new web framework Minimalist.Js. The lead developer wants to advocate for a more seasoned back-end framework that already has a community around it.
Which two frameworks could the lead developer advocate for?
Choose 2 answers
Answer : B, C
Refer to the following code:
function test (val) {
If (val === undefined) {
return 'Undefined values!' ;
}
if (val === null) {
return 'Null value! ';
}
return val;
}
Let x;
test(x);
What is returned by the function call on line 13?
Answer : C
Which two code snippets show working examples of a recursive function?
Choose 2 answers
Answer : A, D
Given the following code:
Let x =('15' + 10)*2;
What is the value of a?
Answer : A
In which situation should a developer include a try .. catch block around their function call ?
Answer : C
developer wants to use a module named universalContainersLib and them call functions
from it.
How should a developer import every function from the module and then call the fuctions foo
and bar ?
Answer : A
Refer to the code below:
console.log(''start);
Promise.resolve('Success') .then(function(value){
console.log('Success');
});
console.log('End');
What is the output after the code executes successfully?
Answer : C
Which code statement below correctly persists an objects in local Storage ?
Answer : A
Considering type coercion, what does the following expression evaluate to?
True + '13' + NaN
Answer : D
Refer to the following array:
Let arr = [1, 2, 3, 4, 5];
Which three options result in x evaluating as [1, 2]?
Choose 3 answer
Answer : B, C, E
Which option is true about the strict mode in imported modules?
Answer : B
A developer at Universal Containers is creating their new landing page based on HTML, CSS, and JavaScript. The website includes multiple external resources that are loaded when the page is opened.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage Is loaded and there Is no need to wait for the resources to be available.
Which statement should be used to call personalizeWebsiteContent based on the above business requirement?
Answer : A
Refer to the code snippet:
Function getAvailabilityMessage(item) {
If (getAvailability(item)){
Var msg =''Username available'';
}
Return msg;
}
A developer writes this code to return a message to user attempting to register a new
username. If the username is available, variable.
What is the return value of msg hen getAvailabilityMessage (''newUserName'' ) is
executed and getAvailability(''newUserName'') returns false?
Answer : D
Which three statements are true about promises ?
Choose 3 answers
Answer : B, C, E
Refer to the code below:
const addBy = ?
const addByEight =addBy(8);
const sum = addBYEight(50);
Which two functions can replace line 01 and return 58 to sum?
Choose 2 answers
Answer : A, D
A Developer wrote the following code to test a sum3 function that takes in an array of
numbers and returns the sum of the first three number in the array, The test passes:
Let res = sum2([1, 2, 3 ]) ;
console.assert(res === 6 );
Res = sum3([ 1, 2, 3, 4]);
console.assert(res=== 6);
A different developer made changes to the behavior of sum3 to instead sum all of the numbers
present in the array. The test passes:
Which two results occur when running the test on the updated sum3 function ?
Choose 2 answers
Answer : A, D
Refer to the code below:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
Answer : C
A developer is setting up a Node,js server and is creating a script at the root of the source code, index,js, that will start the server when executed. The developer declares a variable that needs the folder location that the code executes from.
Which global variable can be used in the script?
Answer : B
Refer to code below:
Function muFunction(reassign){
Let x = 1;
var y = 1;
if( reassign ) {
Let x= 2;
Var y = 2;
console.log(x);
console.log(y);}
console.log(x);
console.log(y);}
What is displayed when myFunction(true) is called?
Answer : C
Refer to the code below:

Which value can a developer expect when referencing country,capital,cityString?
Answer : D
Refer to the code below:

What is the value of result after line 10 executes?
Answer : B
Which two options are core Node.js modules?
Choose 2 answers
Answer : B, D
A developer copied a JavaScript object:

How does the developer access dan's forstName,lastName? Choose 2 answers
Answer : C, D
Refer to code below:
Const objBook = {
Title: 'Javascript',
};
Object.preventExtensions(objBook);
Const newObjBook = objBook;
newObjectBook.author = 'Robert';
What are the values of objBook and newObjBook respectively ?
Answer : A
Refer to the code below:
console.log(''start);
Promise.resolve('Success') .then(function(value){
console.log('Success');
});
console.log('End');
What is the output after the code executes successfully?
Answer : C
Refer to the code:

Given the code above, which three properties are set pet1?
Choose 3 answers:
Answer : B, C, E
Given the following code:
document.body.addEventListener(' click ', (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log('button clicked!');
)
});
Which replacement for the conditional statement on line 02 allows a developer to
correctly determine that a button on page is clicked?
Answer : C
Given the following code, what is the value of x?
let x = '15' + (10 * 2);
Answer : C
Refer to the code below:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
Answer : C
Refer to the code below:
Async funct on functionUnderTest(isOK) {
If (isOK) return 'OK' ;
Throw new Error('not OK');
)
Which assertion accurately tests the above code?
Answer : D
A developer wants to create an object from a function in the browser using the code below.

What happens due to the lack of the mm keyword on line 02?
Answer : A
Given the following code:

is the output of line 02?
Answer : C
Refer to the code below:
Function Person(firstName, lastName, eyecolor) {
this.firstName =firstName;
this.lastName = lastName;
this.eyeColor = eyeColor;
}
Person.job = 'Developer';
const myFather = new Person('John', 'Doe');
console.log(myFather.job);
What is the output after the code executes?
Answer : D