2

When using arrow functions:

[cbCenter, edtTitle].forEach(widget => widget.validate());

The following warning is displayed

enter image description here

The code runs correctly, so I just need to know how to enable the esnext option to get rid of the warning?

Tony BenBrahim
  • 7,040
  • 2
  • 36
  • 49
  • After further research, it appears this is a jshint option, but settings /* jshint esnext */ or /*jshint esversion:6 */ client side results in an invalid option error. So this may be something to be fixed sever side with the linter configuration – Tony BenBrahim Dec 15 '16 at 22:46

1 Answers1

10

The syntax is awkward, you should add the following to the top of your script:

/* jshint esnext:true */

Note that as the other answer says, this will not work for server-side scripts, because Apps Script doesn't support es6. But it will work fine for client-side scripts.

Devin Taylor
  • 825
  • 5
  • 11