Given the JavaScript below:
01 function filterDOM (searchString) {
02 const parsedSearchString = searchString && searchString.toLowerCase() ;
03 document.quesrySelectorAll(' .account' ) . forEach(account => (
04 const accountName = account.innerHTML.toLOwerCase();
05 account. Style.display = accountName.includes(parsedSearchString) ? /*Insert code*/;
06 )};
07 }
Which code should replace the placeholder comment on line 05 to hide accounts that do not match thesearch string?
A. ' Block ' : ' none '
B. ' hidden ' : ' visible '
C. ' name ' : ' block '
D. ' visible ' : ' hidden '
正解:A
質問 2:
Which two code snippets showworking examples of a recursive function?
Choose 2 answers
A. Let countingDown = function(startNumber) {If ( startNumber >0) {console.log(startNumber) ;return countingDown(startNUmber);} else {return startNumber;}};
B. Function factorial ( numVar ) {If (numVar < 0) return;If ( numVar === 0 ) return 1;return numVar -1;
C. Const sumToTen = numVar => {If (numVar < 0)Return;return sumToTen(numVar + 1)};
D. Const factorial =numVar => {If (numVar < 0) return;If ( numVar === 0 ) return 1;returnnumVar * factorial ( numVar - 1 );};
正解:A,D
質問 3:
Cloud Kicks has a class to represent items for sale in an online store, as shown below:
Class Item{
constructor (name, price){
this.name = name;
this.price = price;
}
formattedPrice(){
return 's' + String(this.price);}}
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?
A. Class ClothingItem {
B. Class ClothingItem super Item {
C. Class ClothingItem extends Item {
D. Class ClothingItem implements Item{
正解:C
質問 4:
A developer is trying to handle an error within a function.
Which code segment shows the correct approach to handle an error without propagating it elsewhere?
A.

B.

C.

D.

正解:D
質問 5:
Given the following code:

is the output of line 02?
A. ''null'''
B. ''object''
C. ''x''
D. ''undefined''
正解:B
Aragaki -
JavaScript-Developer-I自学者向けの教科書だと思います。Pass4Testさん本当にありがとうございます。実質4日での合格です。