expected ‘;’ and instead saw ‘=’ [closed]

Think carefully what are you trying to return exactly.

It’s an array of two elements?

return [
   a.style.display === "none", 
   this
];

It’s an object?

return {
   isHidden: (a.style.display === "none"), 
   scope: this
};

Are you just setting the display and then returning this?

  a.style.display = "none";
  return this;

You can’t return two “things”, like return a,b

Leave a Comment