Tell us what’s happening:
I have tried every way to solve this. Need a tip. Tried “return result;” at the bottom after refactoring the code from the example. Then directly as: “return result = str.match(regex);” at the bottom.
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;
const result = str.match(regex);
return result;
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Challenge Information:
Learn Form Validation by Building a Calorie Counter - Step 34