Author Topic: Support for JavaScript iterator and "for-of"  (Read 3161 times)

ahjustat

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Support for JavaScript iterator and "for-of"
« on: March 06, 2019, 02:02:12 am »
Does EA support JavaScript "for-of" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of syntax for iterating through a collection?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Support for JavaScript iterator and "for-of"
« Reply #1 on: March 06, 2019, 03:05:32 am »
There is a reference in the manual/website somewhere that indicates which javascript interpreter is used.

But it seems even easier to just try it no?

Geert

ahjustat

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Support for JavaScript iterator and "for-of"
« Reply #2 on: March 06, 2019, 07:33:27 am »
I tried, but cannot get it to work. Neither 'let' nor 'of' are syntax highlighted as reserved words.

The scripting user guide https://sparxsystems.com.au/resources/user-guides/automation/scripting.pdf states SpiderMonkey 1.8, which is quite old, it looks like.

What do others use? If given the option, I would rather choose a language which isn't Microsoft-specific.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1324
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Support for JavaScript iterator and "for-of"
« Reply #3 on: March 06, 2019, 10:59:10 am »
...
What do others use? If given the option, I would rather choose a language which isn't Microsoft-specific.
I'm with you on that thought but found it easier just to use JScript as most of the examples are in JScript or VBScript.

Happy to help
:)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Support for JavaScript iterator and "for-of"
« Reply #4 on: March 06, 2019, 03:34:19 pm »
I'm using VBScript.
One of the reasons is that it allows easy transfer between VBA (Excel/Word) code and VBScript code as both have a nearly identical syntax.

Geert