0

I was looking for a good solution to use Enumeration in ES6. I've found the following JS library below. But I'm getting some error related to the ES6 syntax for this code.

Source Code: https://gist.github.com/xmlking/e86e4f15ec32b12c4689


"SyntaxError: Unexpected token (2:8)"

[2]


export class EnumSymbol {
    sym **=** Symbol.for(name);
    value: number;
    description: string;

Does anybody have a clue about is code?

Omal Perera
  • 2,971
  • 3
  • 21
  • 26

1 Answers1

0

As commented by Bergi. This is a Typescript code. Description in the source code seems to be incorrect.

Thanks for the heads up @Bergi!

  • Yes Felix. I'll figure out about a best practice for Enum using ES6. About the questions related to Syntax Error, it was answered by Bergi. According to Stackoverflow I'll need to wait until tomorrow to mark this question as solved. At least for my own answer. – Andre Agapito Jul 07 '17 at 11:57