Learn Regular Expressions by Building a Spam Filter - Step 4

Tell us what’s happening:

What could implicit return false mean?as per my code

Your code so far

/* file: script.js */
const messageInput = document.getElementById("message-input");
const result = document.getElementById("result");
const checkMessageButton = document.getElementById("check-message-btn");


// User Editable Region

const  isSpam=(msg)=>{
return  false;
}

// User Editable Region


checkMessageButton.addEventListener("click", () => {
  if (messageInput.value === "") {
    alert("Please enter a message.");
    return;
  }
});

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0

Challenge Information:

Learn Regular Expressions by Building a Spam Filter - Step 4

1 Like

implicit returns were covered in this lesson here

4 Likes
const  isSpam=(msg)=>{
let msg=  false;
} ```

I tried this till here.

Let’s go back to your code here because that was closer to the correct answer

In the implicit return lesson, this was the example code

const multiplyTwoNumbers = (num1, num2) => num1 * num2;

notice how there aren’t any curly braces or return keyword.
It has the => followed by what you want to return

you need to follow the same logic here

hope that is clearer

4 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.