セクション 1. 章 32
single
Challenge: Filter Failure Messages
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Imagine you have a list of system messages, and you need to extract only those containing the word "failure".
Write a program that creates a new array with only these messages and then prints them to the console.
- In the
extractFailureLogs()method, loop through thelogsarray and check each message for the presence of the keyword "failure" (case-insensitive, using thetoLowerCase()method). - Count how many messages contain the word "failure" and store the result in a variable
count. - Loop through the
logsarray again, and add only the messages containing "failure" into theerrorLogsarray.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 32
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください