fix(curriculum): update description for step 5 of spam filter project (#53975)

This commit is contained in:
Supravisor 2024-03-05 21:44:22 +13:00 committed by GitHub
parent e9f0fe6bfa
commit f6e32bf9f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,13 @@ dashedName: step-5
# --description--
Back in your event listener, you need to update the text of the `result` element.
Back in your event listener, you need to update the text of the `result` element. You can use a `ternary` operator to achieve this task.
Here is an example of assigning the result of a ternary operator to an element's text content:
```js
el.textContent = condition ? "Use this text if the condition is true" : "Use this text if the condition is false";
```
After the `if` statement, use a ternary operator to check the truthiness of calling `isSpam()` with `messageInput.value` as the argument. If true, set the `textContent` property on the `result` element to `Oh no! This looks like a spam message.`. Otherwise, set it to `This message does not seem to contain any spam.`