-3

Can you tell what’s wrong with the following code (my eyes are broken)?

class Numbers extends React.Component {
  const arrayOfNumbers = _.range(1, 10);
}
Orace
  • 7,822
  • 30
  • 45

1 Answers1

0

So I put your code in there https://www.typescriptlang.org
And it says A class member cannot have the 'const' keyword.

I think that the issue with your code is that you try to make a class member constant by adding the const keyword.

But a class member cannot have the 'const' keyword. (link found with this amazing tool)

Orace
  • 7,822
  • 30
  • 45