Learn Form Validation by Building a Calorie Counter - Step 34

Tell us what’s happening:

I modified the code but it still doesn’t work as expected and I don’t know where I went wrong. Thanks for viewing this question!

Return the result of calling the .match() method on str and passing your regex variable as the argument. You’ll use this match result later on.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function isInvalidInput(str) {
  const regex = /\d+e\d+/i;
  return str.math(regex);
}

// User Editable Region

Your browser information:

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

Challenge Information:

Learn Form Validation by Building a Calorie Counter - Step 34

1 Like

Theres typo error for the word “match” in your code u used the word “math” instead.

1 Like