can’t we use `.forEach(res => {return res});` o...
# suitescript
k
can’t we use
.forEach(res => {return res});
or something better than that ?
s
Yes, if you use TypeScript and target ES5. I use arrow functions all the time..
in fact, since simple expressions automatically return themselves you could write your contrived snippet as just
.forEach( res => res )
I recognize that wasn't a real example, but plenty of real world one-liners exist and it's nice to not need a
return
statement cluttering things
l
@Kevin or you can use babel to compile the file before uploading to NS.