Build a Fortune Telling App - Step 7

Tell us what’s happening:

What is wrong with this? Am I adding the wrong class, or iterating over the elements wrong, or something else?

Your code so far

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

/* file: styles.css */

/* file: index.ts */
// User Editable Region

const hideElements = (...elements: HTMLElement[]) =>{
  elements.forEach((element) => {
    element.classList.add("hidden");
  })
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36

Challenge Information:

Build a Fortune Telling App - Step 7

GitHub Link: freeCodeCamp/curriculum/challenges/english/blocks/workshop-fortune-teller-app/68ded29daa36f4e42ae63e97.md at main · freeCodeCamp/freeCodeCamp · GitHub

Hey @neat-hannah

Your code satisfies all the requirements, but for some reason, it’s not being accepted. However, if you use an implicit return rather than an explicit return for forEach, it works. Also, for some reason, it’s only accepting the el parameter.