최신Salesforce Certified JavaScript Developer (JS-Dev-101) - JavaScript-Developer-I무료샘플문제
문제1
static delay = async delay = > {
return new Promise(resolve = > {
setTimeout(resolve, delay);
});
};
static asyncCall = async () = > {
await delay(1000);
console.log(1);
};
console.log(2);
asyncCall();
console.log(3);
Assume delay and asyncCall are in scope as functions.
What is logged to the console?
static delay = async delay = > {
return new Promise(resolve = > {
setTimeout(resolve, delay);
});
};
static asyncCall = async () = > {
await delay(1000);
console.log(1);
};
console.log(2);
asyncCall();
console.log(3);
Assume delay and asyncCall are in scope as functions.
What is logged to the console?
정답: B
설명: (KoreaDumps 회원만 볼 수 있음)
문제2
Refer to the code below:
01 let country = {
02 get capital() {
03 let city = Number( " London " );
04
05 return {
06 cityString: city.toString(),
07 }
08 }
09 }
Which value can a developer expect when referencing country.capital.cityString?
Refer to the code below:
01 let country = {
02 get capital() {
03 let city = Number( " London " );
04
05 return {
06 cityString: city.toString(),
07 }
08 }
09 }
Which value can a developer expect when referencing country.capital.cityString?
정답: C
설명: (KoreaDumps 회원만 볼 수 있음)
문제3
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 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?
정답: B
설명: (KoreaDumps 회원만 볼 수 있음)
문제4
Which three actions can the code execute in the browser console?
Which three actions can the code execute in the browser console?
정답: A,C,D
설명: (KoreaDumps 회원만 볼 수 있음)
문제5
A developer creates a simple webpage with an input field. When a user enters text and clicks the button, the actual value must be displayed in the console:
HTML:
< input type= " text " value= " Hello " name= " input " >
< button type= " button " > Display < /button >
JavaScript:
01 const button = document.querySelector( ' button ' );
02 button.addEventListener( ' click ' , () = > {
03 const input = document.querySelector( ' input ' );
04 console.log(input.getAttribute( ' value ' ));
05 });
When the user clicks the button, the output is always " Hello " .
What needs to be done to make this code work as expected?
A developer creates a simple webpage with an input field. When a user enters text and clicks the button, the actual value must be displayed in the console:
HTML:
< input type= " text " value= " Hello " name= " input " >
< button type= " button " > Display < /button >
JavaScript:
01 const button = document.querySelector( ' button ' );
02 button.addEventListener( ' click ' , () = > {
03 const input = document.querySelector( ' input ' );
04 console.log(input.getAttribute( ' value ' ));
05 });
When the user clicks the button, the output is always " Hello " .
What needs to be done to make this code work as expected?
정답: D
설명: (KoreaDumps 회원만 볼 수 있음)
문제6
Refer to the code below:
let productSKU = ' 8675309 ' ;
A developer has a requirement to generate SKU numbers that are always 19 characters long, starting with ' sku ' , and padded with zeros.
Which statement assigns the value sku000000008675309?
Refer to the code below:
let productSKU = ' 8675309 ' ;
A developer has a requirement to generate SKU numbers that are always 19 characters long, starting with ' sku ' , and padded with zeros.
Which statement assigns the value sku000000008675309?
정답: C
설명: (KoreaDumps 회원만 볼 수 있음)
문제7
Refer to the code below:
01 const objBook = {
02 title: ' JavaScript ' ,
03 };
04 Object.preventExtensions(objBook);
05 const newObjBook = objBook;
06 newObjBook.author = ' Robert ' ;
What are the values of objBook and newObjBook respectively?
Refer to the code below:
01 const objBook = {
02 title: ' JavaScript ' ,
03 };
04 Object.preventExtensions(objBook);
05 const newObjBook = objBook;
06 newObjBook.author = ' Robert ' ;
What are the values of objBook and newObjBook respectively?
정답: B
설명: (KoreaDumps 회원만 볼 수 있음)