0

I am trying to use enum in a app script. The following code causes Missing ; before statement. (line 2, file "Code")

function test() {
  enum myEnum { bar, foo }

  for (var enumMember in myEnum) {
    console.log("enum member: ", enumMember);
  }
}
BigEd
  • 1
  • I think your `enum myEnum { bar, foo }` is missing the `;` at the end. But not sure if it's needed as it depends on the language. – Steven Jun 06 '19 at 14:39
  • 1
    Possible duplicate of [What is the preferred syntax for defining enums in JavaScript?](https://stackoverflow.com/questions/287903/what-is-the-preferred-syntax-for-defining-enums-in-javascript) – Cooper Jun 06 '19 at 14:41

0 Answers0