Free JS-Dev-101 Questions for Salesforce Certified JavaScript Developer - Multiple Choice JS-Dev-101 Exam as PDF & Practice Test Engine
Refer to the code snippet:
01 let array = [1, 2, 3, 4, 4, 5, 4, 4];
02 for (let i = 0; i < array.length; i++) {
03 if (array[i] === 4) {
04 array.splice(i, 1);
05 i--;
06 }
07 }
What is the value of array after the code executes?
01 let array = [1, 2, 3, 4, 4, 5, 4, 4];
02 for (let i = 0; i < array.length; i++) {
03 if (array[i] === 4) {
04 array.splice(i, 1);
05 i--;
06 }
07 }
What is the value of array after the code executes?
Correct Answer: C
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Given the following code:
let x = ('15' + 10) * 2;
What is the value of x?
let x = ('15' + 10) * 2;
What is the value of x?
Correct Answer: A
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Given the code below:
01 function Person(name, email) {
02 this.name = name;
03 this.email = email;
04 }
05
06 const john = new Person('John', '[email protected]');
07 const jane = new Person('Jane', '[email protected]');
08 const emily = new Person('Emily', '[email protected]');
09
10 let usersList = [john, jane, emily];
Which method can be used to provide a visual representation of the list of users and to allow sorting by the name or email attribute?
01 function Person(name, email) {
02 this.name = name;
03 this.email = email;
04 }
05
06 const john = new Person('John', '[email protected]');
07 const jane = new Person('Jane', '[email protected]');
08 const emily = new Person('Emily', '[email protected]');
09
10 let usersList = [john, jane, emily];
Which method can be used to provide a visual representation of the list of users and to allow sorting by the name or email attribute?
Correct Answer: A
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Refer to the code below:
01 x = 3.14;
02
03 function myFunction() {
04 'use strict';
05 y = x;
06 }
07
08 z = x;
09 myFunction();
Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?
01 x = 3.14;
02
03 function myFunction() {
04 'use strict';
05 y = x;
06 }
07
08 z = x;
09 myFunction();
Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?
Correct Answer: A,C,D
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Code:
01 let array = [1, 2, 3, 4, 4, 5, 4, 4];
02 for (let i = 0; i < array.length; i++) {
03 if (array[i] === 4) {
04 array.splice(i, 1);
05 i--;
06 }
07 }
What is the value of array after execution?
01 let array = [1, 2, 3, 4, 4, 5, 4, 4];
02 for (let i = 0; i < array.length; i++) {
03 if (array[i] === 4) {
04 array.splice(i, 1);
05 i--;
06 }
07 }
What is the value of array after execution?
Correct Answer: C
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Most accurate tests for:
const arr = Array(5).fill(0);
const arr = Array(5).fill(0);
Correct Answer: A,D
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Refer to the code below:
let strNumber = '12345';
Which code snippet shows a correct way to convert this string to an integer?
let strNumber = '12345';
Which code snippet shows a correct way to convert this string to an integer?
Correct Answer: A
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Refer to the HTML below:
<div id="main">
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing "Leo" to "The Lion"?
<div id="main">
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing "Leo" to "The Lion"?
Correct Answer: B
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Refer to the code below:
01 let total = 10;
02 const interval = setInterval(() => {
03 total++;
04 clearInterval(interval);
05 total++;
06 }, 0);
07 total++;
08 console.log(total);
Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?
01 let total = 10;
02 const interval = setInterval(() => {
03 total++;
04 clearInterval(interval);
05 total++;
06 }, 0);
07 total++;
08 console.log(total);
Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?
Correct Answer: B
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
Refer to the following code:
01 let obj = {
02 foo: 1,
03 bar: 2
04 }
05 let output = []
06
07 for (let something of obj) {
08 output.push(something);
09 }
10
11 console.log(output);
What is the value of output on line 11?
01 let obj = {
02 foo: 1,
03 bar: 2
04 }
05 let output = []
06
07 for (let something of obj) {
08 output.push(something);
09 }
10
11 console.log(output);
What is the value of output on line 11?
Correct Answer: D
Vote an answer
Explanation: Only visible for ExamDiscuss members. You can sign-up / login (it's free).
0
0
0
10
