최신 JavaScript-Developer-I 무료덤프 - Salesforce Certified JavaScript Developer I
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?
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?
정답: C
A developer is required to write a function that calculates the sum of elements in an array but is getting undefined every time the code is executed. The developer needs to find what is missing in the code below.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
//
Result += current;
//
), 10);
);
Which option makes the code work as expected?
정답: B
Refer to the following code:
Let obj ={
Foo: 1,
Bar: 2
}
Let output =[],
for(let something in obj{
output.push(something);
}
console.log(output);
What is the output line 11?
Let obj ={
Foo: 1,
Bar: 2
}
Let output =[],
for(let something in obj{
output.push(something);
}
console.log(output);
What is the output line 11?
정답: 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 array after the code executes?
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 array after the code executes?
정답: A
is below:
<input type="file" onchange="previewFile()">
<img src="" height="200" alt="Image Preview..."/>
The JavaScript portion is:
01 functionpreviewFile(){
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.src = reader.result;
07 },false);
08 //line 8 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?
<input type="file" onchange="previewFile()">
<img src="" height="200" alt="Image Preview..."/>
The JavaScript portion is:
01 functionpreviewFile(){
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.src = reader.result;
07 },false);
08 //line 8 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?
정답: C
Refer to code below:
function Person() {
this.firstName = 'John';
}
Person.prototype ={
Job: x => 'Developer'
};
const myFather = new Person();
const result=myFather.firstName + ' ' + myFather.job();
What is the value of the result after line 10 executes?
function Person() {
this.firstName = 'John';
}
Person.prototype ={
Job: x => 'Developer'
};
const myFather = new Person();
const result=myFather.firstName + ' ' + myFather.job();
What is the value of the result after line 10 executes?
정답: C
A developer wants to set up a secure web server withNode.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?
정답: B
Refer to the codebelow:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
정답: D
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?
Following semantic versioning format, what should the new package version number be?
정답: C
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?
console.log(''start);
Promise.resolve('Success') .then(function(value){
console.log('Success');
});
console.log('End');
What is the output after the code executes successfully?
정답: B
A developer has the function, shown below, that is called when a page loads.

Where can the developer see the log statement after loading the page in the browser?

Where can the developer see the log statement after loading the page in the browser?
정답: C
A developer writers the code below to calculate the factorial of a given number.
Function factorial(number) {
Return number + factorial(number -1);
}
factorial(3);
What is the resultof executing line 04?
Function factorial(number) {
Return number + factorial(number -1);
}
factorial(3);
What is the resultof executing line 04?
정답: B
Refer to the code below:
Const resolveAfterMilliseconds = (ms) => Promise.resolve (
setTimeout ((=> console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500);
Const bPromise = await resolveAfterMilliseconds(500);
Await aPromise, wait bPromise;
What is the result of running line 05?
Const resolveAfterMilliseconds = (ms) => Promise.resolve (
setTimeout ((=> console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500);
Const bPromise = await resolveAfterMilliseconds(500);
Await aPromise, wait bPromise;
What is the result of running line 05?
정답: C
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?
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?
정답: A
A developer is creating a simple webpage with a button. When a userclicks 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 functionlisten(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
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 functionlisten(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
정답: B,D
The developer wants to test the array shown:
const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ?
Choose 2 answers:
const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ?
Choose 2 answers:
정답: B,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?
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?
정답: C
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 ?
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 ?
정답: A
A developer wrote a fizzbuzz function thatwhen passed in a number, returns the following:
'Fizz' if the number is divisible by 3.
'Buzz' if the number is divisible by 5.
'Fizzbuzz' if the number is divisible by both 3 and 5.
Empty string if the number is divisible by neither 3 or 5.
Whichtwo test cases will properly test scenarios for the fizzbuzz function?
Choose 2 answers
'Fizz' if the number is divisible by 3.
'Buzz' if the number is divisible by 5.
'Fizzbuzz' if the number is divisible by both 3 and 5.
Empty string if the number is divisible by neither 3 or 5.
Whichtwo test cases will properly test scenarios for the fizzbuzz function?
Choose 2 answers
정답: A,B,C