Exam4Training

05 account. Style.display = accountName.includes(parsedSearchString)?

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*/;

6 )};

7 }

Which code should replace the placeholder comment on line 05 to hide accounts that do not match the search string?
A . ‘ name ’: ‘ block ’
B . ‘ Block ’: ‘ none ’
C . ‘ visible ’: ‘ hidden ’
D . ‘ hidden ’: ‘ visible ’

Answer: B

Exit mobile version