<< Prev Question Next Question >>

Question 41/60

Given the JavaScript below:
01 function filterDOM(searchString){
02 const parsedSearchString = searchString && searchString.toLowerCase();
03 document.querySelectorAll('.account').forEach(account => {
04 const accountName = account.innerHTML.toLowerCase();
05 account.style.display = accountName.includes(parsedSearchString) ? /* Insert code here */;
06 });
07 }
Which code should replace the placeholder comment on line 05 to hide accounts that do not match the search string?

LEAVE A REPLY

Your email address will not be published. Required fields are marked *

Question List (60q)
Question 1: Refer to the code below: 01 let sayHello = () =&gt; { 02 con...
Question 2: Refer to the code below: class Student { constructor(name) {...
Question 3: Refer to the code: 01 console.log('Start'); 02 Promise.resol...
Question 4: Refer to the code below: 01 let o = { 02 get js() { 03 let c...
Question 5: Given the following code: let x = ('15' + 10) * 2; What is t...
Question 6: A developer publishes a new version of a package with new fe...
Question 7: A developer creates a new web server that uses Node.js. It i...
Question 8: Given the code below: 01 function Person(name, email) { 02 t...
Question 9: A developer is setting up a new Node.js server with a client...
Question 10: Refer to the code: const pi = 3.1415926; What is the data ty...
Question 11: Which statement accurately describes the behavior of the asy...
Question 12: A developer creates a simple webpage with an input field. Wh...
Question 13: Refer to the code below: 01 &lt;html lang="en"&gt; 02 &lt;ta...
Question 14: A developer wants to catch any error that countSheep() may t...
Question 15: Refer to the following code: 01 class Ship { 02 constructor(...
Question 16: Refer to the code below: 01 let timedFunction = () =&gt; { 0...
Question 17: A developer wants to advocate for a mature, well-supported w...
Question 18: A developer is trying to convince management that their team...
Question 19: A developer initiates a server with the file server.js and a...
Question 20: Which statement accurately describes an aspect of promises?...
Question 21: A developer executes: document.cookie; document.cookie = 'ke...
Question 22: Original code: 01 let requestPromise = client.getRequest; 03...
Question 23: A developer removes the HTML class attribute from the checko...
Question 24: static delay = async delay =&gt; { return new Promise(resolv...
Question 25: Universal Containers (UC) just launched a new landing page, ...
Question 26: A page loads 50+ &lt;div class="ad-library-item"&gt; element...
Question 27: A developer has a module that contains multiple functions. W...
Question 28: Given the code: 01 function GameConsole(name) { 02 this.name...
Question 29: Refer to the code snippet: 01 let array = [1, 2, 3, 4, 4, 5,...
Question 30: Which three browser specific APIs are available for develope...
Question 31: Given the JavaScript below: function onLoad() { console.log(...
Question 32: Refer to the code below: 01 new Promise((resolve, reject) =&...
Question 33: Why does second have access to variable a?...
Question 34: Refer to the code below: let productSKU = '8675309'; A devel...
Question 35: Refer to the following array: let arr = [1, 2, 3, 4, 5]; Whi...
Question 36: What are two unique features of fat-arrow functions compared...
Question 37: Given a value, which two options can a developer use to dete...
Question 38: Refer to the code below: 01 let total = 10; 02 const interva...
Question 39: const str = 'Salesforce'; Which two statements result in the...
Question 40: Refer to the code below: 01 x = 3.14; 02 03 function myFunct...
Question 41: Given the JavaScript below: 01 function filterDOM(searchStri...
Question 42: Which actions can be done using the JavaScript browser conso...
Question 43: Refer to the code below: 01 function myFunction(reassign) { ...
Question 44: A developer has an isDeg function that takes one argument, p...
Question 45: A developer uses a parsed JSON string to work with user info...
Question 46: Corrected code: let a = "*"; let b = "**"; // x = 3; console...
Question 47: Refer to the code: 01 function execute() { 02 return new Pro...
Question 48: A developer implements a function that adds a few values. fu...
Question 49: Refer to the code below (assuming Promise.race is intended):...
Question 50: A developer wrote the following code: 01 let x = object.valu...
Question 51: 01 function Animal(size, type) { 02 this.type = type || 'Ani...
Question 52: A developer wants to use a try...catch statement to catch an...
Question 53: A developer is setting up a Node.js server and is creating a...
Question 54: Refer to the code below (corrected to use a template literal...
Question 55: A developer writes the code below to return a message to a u...
Question 56: Correct implementation of try...catch for countsDeep():...
Question 57: Refer to the code below: flag(); function flag() { console.l...
Question 58: Refer to the code: 01 const exec = (item, delay) =&gt; 02 ne...
Question 59: A developer is leading the creation of a new web server for ...
Question 60: Which two console logs output NaN?...