Set 1
Set 1
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on the page is clicked? &
[ZKRYTERION a
‘ Test Aids
22 of 60. 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
A@ function leg(logInput) {
B. const log(loginInput) {
[ZKRYTERION
Test Aids
partner
Ba cicea TESTING SOLUTIONS
Single Book
23 of 60. 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?
ned
——
27 of 60. A developer wants to create an object from a function in the browser using the code below.
If KRYTERION' pares ®
Test Aids
Choose 2 answers | |
A. console.log(10 / Number('5")); | |
} |
og console.loeg(10 / 'five');
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. I KRYTERION™
© Sentinel Secure ? x
01 function filterDOM(searchString){
02 const parsedSearchString = séarchString && searchString.toLowerCase ();
03 document.querySelectorAll('.account').forBach(account => {
04 const accountName = account. innerHTML.toLowerCase (); Pencil& Paper
os account.style.display = accountName.includes(parsedSearchString) ? /* Insert code here */;
06 be
07 }
7 Written
Which code should replace the placeholder comment on line 05 to hide accounts that do not match the search string? Mates
A. 'visible' : "hidden’
von ou
| KRYTERION’
Ba cicea TESTING SOLUTIONS
01 console.log('Start'):
02 Promise.resolve('Success').then(function(value) {
03 console.log('Success');
04 })F
OS console.log('End');
A. Start
Success
End
B. End
Start
Success
c. °o Start
End
Success
D. Success
Start
End
ew Sentinel Secure ? x
[ZKRYTERION
‘ Test Aids
partner
Be cioea. TESTING SOLUTIONS
A. removeTimeout (timedFunction) ;
B. removeTimeout (timerId) ;
co clearTimeout (timerId);
D. clearTimeout (timedFunction) ;
[ZKRYTERION
Test Aids
partner
Ba cicea TESTING SOLUTIONS
Single Book
I KRYTERION’
Be cicea. TESTING SOLUTIONS
partner ®
|
D. ["Garlic bread']
If KRYTERION”
BS ciceA TESTING SOLUTIONS
partner |
Single Book
60 of 60. Which option is true about the strict mode in imported modules?
A. Imported modules are in strict mode whether you declare them as such or not.
8. °o A developer can only reference notStrict () functions from the imported module.
Cc. Add the statement use strict = false; before any other statements in the module to enable not-strict mode.
D. Add the statement use non-strict; before any other statements in the module to enable not-strict mode.
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. |EKRYTERION™
ew Sentinel Secure ? x
IZ KRYTERION
Test Aids
partner
GLOBAL TESTING SOLUTIONS
A developer has a requirement to generate SKU numbers that are always 19 characters long, starting with ‘sku’, and padded with zeros.
ss
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. IE KRYTERION™
© Sentinel Secure ? x
Single Book
2of 60. A developer wants to use a try...catch statement to catch any error that countSheep () may throw and pass it to a handleError () function.
AO try {
setTimeout (function() {
countSheep
();
}, 1000);
catch (6) {
handleError (e);
B. try {
countSheep
() 7
finally {
handleError (e);
¢. setTimeout (function() {
try {
countSheep
({);
catch (e) {
handleError (€);
}
}, 1000);
DB. try {
countSheep
()7
handleError (e€){
catch (es):
ew Sentinel Secure ? x
Choose 2 answers
A. runParallel ().then (data);
Single Book
Time Remaining : 01:16:58
Bo
09
10
})
.catch(err => { US
ll g¢
console.log("Race is cancelled.", ’ err);Ve Written
1200 ))e Materials
If KRYTERION’
BS ciceA TESTING SOLUTIONS
partner ®
Salesforce Certified JavaScript Developer I - Multiple Choice (SP21) @
Multiple Books
Time Remaining : 01:16:16
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. |EIKRYTERION™
© Sentinel Secure ? x
KRYTERION —
A. "["false", {})"
B. "(false, {}]"
[ZKRYTERION
‘ Test Aids
partner
Be cioea. TESTING SOLUTIONS
ae
Book
7 of 60. A developer removes the HTML class attribute from the checkout button, so now it is simply:
<button>Checkout</button>.
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.
A. True positive
B. True negative
c. False positive
0. False negative
KRYTERION —
8 of 60. Given two expressions varl and var2, what are two valid ways to return the logical AND of the two expressions and ensure it is data type
Calculator
Boolean?
Choose 2 answers |
A@ Boolean(varl) && Boolean (var2) |
je
B. varl.toBoolean() && var2.toBoolean() Pencil & Paper
J
Written
Mark this item for later review. Materials
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. IE KRYTERION™
ew Sentinel Secure ? x
01 class Vehicle [{
02 constructor(plate) {
03 this.plate = plate;
04 }
os }
06
07 class Truck extends Vehicle {
os constructor (plate, weight){
os //Missing code
10 this.weight = weight;
il }
12 displayWeight() {
13 console.log(*The truck ${this.plate} has a weight of ${this.weight} lb.*);
14 }
Materials
Which statement should be added to line 09 for the code to display ‘The truck 123AB has a weight of 5000 Ib.'?
Ao super (plate);
B. super.plate = plate;
KRYTERION —
&> partner fz }
I<”, KRYTERION”
B cic8m TESTING SOLUTIONS
Single Book
10 of 60. Considering type coercion, what does the following expression evaluate to?
AO "truel3NaN'
B. "true13'
Cc. 14
D. '113NaN'
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. IE KRYTERION™
ew Sentinel Secure ? x
” KRYTERION partner
Be cioea, TESTING SOLUTIONS
11 of 60. 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.
If KRYTERION”
BS ciceA TESTING SOLUTIONS
partner ®
Single Book
9
8
A. o JSON. parse (""foo"');
B. JSON.parse (""foo'");
@
Cc. JSON.parse ("foo");
D. JSON.parse ("foo");
i
i:
Mark this item for later review.
ig
Materials
|
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. |f\KRYTERION™
© Sentinel Secure ? x
KRYTERION —
01 let x = null;
02 console.log(typeof x);
A. "x"
B. “null”
Cc. o “object
D. "undefined"
catch (err) {
In
first = 'Why';
038 throw err:
09 } finally {
10 second = 'When';
}
catch (err) {
Me
econd = 'Where';
we
w
oe
»
What are the values for first and second once the code executes?
15 of 60. A 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?
A. 1.1.4
B.© 1.2.0
c. 1.2.3
D. 2.0.0
01 <html lang="en">
02 <table onclick="console.log('Table log');">
03 <tr id="rowl">
<td>Click me!</td>
</tr>
</table>
<script>
function printMessage (event) {
console.log('Row log');
Which code change should be made for the console to log only Row log when "Click me!’ is clicked?
I KRYTERION’
Be cioea. TESTING SOLUTIONS
partner ®
}
17 of 60. 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 ee
A. @ White box ea
B.| Stubbing
1
ce. Black box
D. Substitution
19 of 60. A developer wants to create a simple image upload in the browser using the File API. The HTML is below:
01 function previewFile() {
02 const preview = document.querySelector('img');
03 const file = document. querySelector
("input [type=file]').files[0];
04 // line 4 code
05 reader.addEventListener ("load", () => {
06 preview.srce = reader.result;
07 }, false);
08 //line 6 code
09 }
In lines 04 and 08, which code allows the user to select an image from their local computer, and to display the image in the browser?
[ZKRYTERION" bine Te
Test Aids
Written
Materials
When does Promise. finally on line 08 get called?
Cc When resolved
D. When rejected
[ZKRYTERION
5 Test Aids
partner Ba
Be cioea, TESTING SOLUTIONS
Single Book
w
=)
Which code segment shows a correct way to convert this string to an integer?
KRYTERION Version:
im
16.0.0
Test Aids
a orce Certifie avascrip’ eveloper 1 - Multiple oice )
01 class Item {
02 constructor(name, price) {
Multiple Books
03 this.name = name;
a
04 this.price = price;
os }
06
07 formattedPrice() {
08 return '$' + String(this.price);
09 }
10 }
A new business requirement comes in that requests a ClothingItem class, that should have all of the properties and methods of the Item
class, but will also have properties that are specific to clothes.
Which line of code properly declares the ClothingItem class such that it inherits from Item?
D. class ClothingItem {
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
A. ‘update', '123abc'
8.@ ‘update’, {
detail : {
recordId : '123abc'
}
c@ ‘update’, {
recordId : '123abc'
}
D. {type : ‘update’, recordId : "l23abc'}
01 setCurrentUrl
();
02 console.log('The current URL is: ' + url);
@
03
04 function setCurrentUrl() { Pencil
& Paper
os url = window. location. href; ———
06 } =
Wy
What happens when the code executes? oO
Written
A. The url variable has global scope and line 02 throws an error. Materials
B. The url variable has local scope and line 02 throws an error.
C.. The url variable has local scope and line 02 executes correctly.
0. The url variable has global scope and line 02 executes correctly.
KRYTERION Version:
‘
16.0.0
Test Aids
8
——
28 of 60. 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?
| KRYTERION”
BS cicen TESTING SOLUTIONS
partner ®
Salesforce Certified JavaScript Developer I - Multiple Choice (SP21)
<div id="main">
<div id="card-00">This card is smaller.</div>
<div id="card-01">The width and height of this card is determined by its contents.</div>
</div>
Which expression outputs the screen width of the element with the ID card-01?
li” KRYTERION’
B cicea TESTING SOLUTIONS
partner
Single Book
30 of 60. Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions anny
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. |
05 5 thiscouldTakeTooLong();
06
07 M: h
7 Written
07 () r
orMaybeThisoOne Mater
08
09 console.endTime ("Performance");
Which function can the developer use to obtain the time spent by every one of the three functions?
AO console. timeLog ()
B. console.timeStamp ()
Cc. console.trace()
D. console.getTime ()
ew Sentinel Secure ? x
1 KRYTERION
Test Aids
partner
Be acen TESTING SOLUTIONS
Single Book
Pencil
& Paper
The developer needs to insert a code statement in the location shown. The code statement has these requirements:
1. Does not require an import
2. Logs an error when the Boolean statement evaluates to false
3. Works in both the browser and Node.js
Written
Which statement meets these requirements? Materials
r KRYTERION partner
Ba cicen. TESTING SOLUTIONS
Single Book
32 of 60. 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.
Written
Materials
Which two results occur when running this test on the updated sum3 function?
Choose 2 answers
AL The line 05 assertion passes.
34 of 60. A developer wants to set up a secure web server with Node.js. The developer creates a directory locally called app-server, and the first file
is app-server/index.js.
Without using any third-party libraries, what should the developer add to index. js to create the secure web server?
35 of 60. A developer creates a class that represents a blog post based on the requirements that a Post should have a body, author, and view count.
The code is shown below:
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instance of a Post with the three
attributes correctly populated?
B. constructor() {
Cc. super (body, author, viewCount) {
If KRYTERION’
Ba aicen. TESTING SOLUTIONS
partner | @
Single Book
36 of 60. 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:
Tired of all the ads, what can the developer do to temporarily and quickly remove them?
B.© Use the browser console to execute a script that removes all the elements containing the class ad-library-item.
Gc. Use the browser console to execute a script that prevents the load event to be fired.
D. Use the DOM inspector to remove all the elements containing the class ad-library-item.
{KRYTERION
Test Aids
partner
Ba cicen. TESTING SOLUTIONS
AL [l, 2, 34 4+ Se 4, 4]
39 of 60. A developer has a web server running with Node.js. The command to start the web server is node server.js. The web server started having
latency issues. Instead of a one second turnaround for web requests, the developer now sees a five second turnaround.
Which command can the web developer run to see what the module is doing during the latency period?
[Z/KRYTERION”
Test Aids
partner
Ba cicen. TESTING SOLUTIONS
Single Book
01 function changeValue(param) {
02 param = 5;
03 }
et
ao
u
a
oH Gb
ooo
changeValue (b) ;
oI
AO 10-10
B. 5-5
Cc 10-5
D. 5-10
]
41 of 60. Refer to the code:
Single Book
01 function Animal (size, type) {
02 this.type = type || ‘Animal';
03 this.canTalk = false;
o4 }
os
06 Animal.prototype.speak = function() {
07 if (this.canTalk) {
08 console.log("It spoke!");
os }
10);
il
12 let Pet = function(size, type, name, owner) {
13 Animal.call(this, size, type);
14 this.size = size;
15 this.name = name;
16 this.owner = owner;
17 }
18
19 Pet.prototype = Object.create (Animal .prototype):
20 let petl = new Pet();
Given the code above, which three properties are set for peti?
Choose 3 answers
AL speak
B. Qa owner
e. a type
D. name
E. canTalk
ew Sentinel Secure ? x
01 setTimeout(() => {
02 console.log(1);
be O}F
im )
oO «
console.log(2);
new Promise((resolve, reject) => {
o oo
setTimeout(() => {
IA
reject (console.log(3))i
08 =}, 1000);
9 }).catch(() => {
10 console.log(4);
11 ))e
12 console.log(5):
AO 25134
B. 21435
Cc. 12534
D. 12435
[KRYTERION
Test Aids
partner
Be cLoea TESTING SOLUTIONS
06 Person.job = 'Developer';
3
console.log(myFather.job) ;
o;°o
©
Cc. °o undefined
D. Developer
Option A:
@1 function Monster() {
@2 this.growl - () => {
@3 console. log(“Grr!*);
a}
@5 }
Option B:
@1 function Monster() {};
@2 Monster. prototype.growl = () => {
@3 = console. log("Grr!"); Written
ea } Materials
How many growl methods are created with Option A and Option B?
co 1000 growl methods are created for Option A. 1 growl method is created for Option B.
D. 1 growl method is created for Option A. 1000 growl methods are created for Option B.
© Sentinel Secure ? x
[ZKRYTERION —_ &)
Test Aids
46 of 60. A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.
debugger;
Oo
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console?
Choose 2 answers
A. The values of the carSpeed and fourWheels variables
B. The style, event listeners and other attributes applied to the carSpeed DOM element
C: A variable displaying the number of instances created for the Car object
.g The information stored in the window.localStorage property
[ZKRYTERION —_ &)
Test Aids
46 of 60. A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.
debugger;
Oo
When the code execution stops at the breakpoint on line 06, which two types of information are available in the browser console?
Choose 2 answers
A. The values of the carSpeed and fourWheels variables
B. The style, event listeners and other attributes applied to the carSpeed DOM element
C: A variable displaying the number of instances created for the Car object
.g The information stored in the window.localStorage property
[Z/KRYTERION”
Test Aids
partner
Ba cicea TESTING SOLUTIONS
Single Book
A. ii
B. 36
Cc. 25
0. 16
© Sentinel Secure ? x
Choose 2 answers
A8 [].concat.apply({], inArray);
B.@ [).concat(...inArray);
c. {]).concat.apply(inArray, []);
D. [ -concat([...inArray]);
51 of 60. A developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server
functionality.
The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any
issues that the server has while booting up.
Given the code and the information the developer has, which code logs an error at boot time with an event?
A. Ol server.error((error) => {
02 console.log('ERROR', error);
03 }):
1 server.catch((error) => {
}2 console.log('ERROR', error);
3
02 server.start();
03 } catch(error) {
04 console.log('ERROR', error);
os }
© Sentinel Secure ? x
If KRYTERION’
BS ciceA TESTING SOLUTIONS
partner ®
Salesforce Certified JavaScript Developer I - Multiple Choice (SP21) @
Multiple Books
Time Remaining : 01:05:12
52 of 60. What are two unique features of functions defined with a fat arrow as compared to normal function definition?
Choose 2 answers
A. The function generates its own this making it useful for separating the function's scope from its enclosing scope.
B. The function receives an argument that is always in scope, called parent This, which is the enclosing lexical scope
& If the function has a single expression in the function body, the expression will be evaluated and implicitly returned.
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. |EKRYTERION™
© Sentinel Secure ? x
I KRYTERION’
Be cicea. TESTING SOLUTIONS
partner ®
Salesforce Certified JavaScript Developer I - Multiple Choice (SP21) |
Multiple Books
Time Remaining : 01:04:57
54 of 60. A developer at Universal Containers creates a new landing page based on HTML, CSS, and JavaScript.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage is fully
loaded (HTML content and all related files), in order to do some custom initialization.
Which statement should be used to call personalizeWebsiteCcontent based on the above business requirement?
A. window.addEventListener('onload', personalizeWebsiteContent);:
—_ ou
I KRYTERION’
Be. cicea TESTING SOLUTIONS
06 );
JI
IZ KRYTERION’ QP vorve
‘ Test Aids
const pi = 3.1415926;
A. Double
B. Decimal
C.@ Number
D. Float
If KRYTERION’
BS ciceA TESTING SOLUTIONS
FH vw ®
Single Book
A. los
8. locale
Cc memory
D. °o path
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. |EIKRYTERION™
© Sentinel Secure ? x
[:KRYTERION’ _
z Test Aids
S
Time Remaining : 01:04:24
01 function getAvailabilityMessage
(item) { |
02 if (getAvailability(item)) { &
03 var msg = “Username available"; i J
04 } Pencil
& Paper
os return msg;
“
A developer writes this code to return a message to a user attempting to register a new username. If the username is available, a variable :
named msg is declared and assigned a value on line 03. pri
A. °o undefined
B. “msg is not defined"
Cc. "Username available"
D. “newUserName"
r KRYTERION
Nersn TESTING SOLUTIONS
partner
Single Book
01 const objBook = {
02 title: 'JavaScript'
03 }3
04 Object .preventExtensions (objBook) ; Pencil
& Paper
05 const newObjBook = objBook;
06 newObjBook.author = 'Robert';
Your assessment responses are listed below. Asterisks(*) next to the item number indicate you have marked that item for review. Click on the item number ®
to return to the desired item. When you are ready to submit your assessment, click the 'Submit Exam’ button below to submit your responses and end the Binge 20a).
assessment. i
Assessment Summary @
Number of Items Answered: 60 Multiple Books
Number of Items Unanswered: 0
Number of Items Marked for Review: 0 g
Answers SS
Calculator
Lc 2A 3.DC 4.A
2B 6.C Z.D 8. DA x
9A 10. A 11.D 12.A Q
13.C 14.¢ 15.8 16. D e
17. AD 18. C 19.D 20.4 Pencil & Paper
2LC 22, AC 23. D 24.4
25..BC 26.0 22.8 28.8 a
29.8 30.A aL 32..DB WS |
33. DB 34.D 33.4 36.68
1 KRYTERION
GLOBAL TESTING SOLUTIONS
partes
Salesforce Certified JavaScript Developer I - Multiple Choice (SP21)
Exit Test
2021 KRYTERION, Inc. and KRYTERION, Limited - All Rights Reserved. IE KRYTERION™