On what version of javascript does netsuite currently run SuiteScripts?
This is my understanding: SuiteScript is a NetSuite scripting API that runs on a javascript engine. Javascript has multiple versions (E.G. ES6 and ES7). Which version does this engine use? Or, maybe I should be asking "What javascript engine does SuiteScript run on?". Then I could look up which version of javascript that engine runs on?
Let me give a practical example of what I'm getting at. In javascript version ECMAScript 7, you can declare an async function, but you cannot in ECMAScript 6. Can I declare an "async function" in SuiteScript? (arbitrary example)
For Server side, I believe it is ECMAScript 5 (or so it has worked that way for my purposes). So no async/await, sorry. You can use your own implementation of Promises (or use Suitescript 2.0 which includes promises). Client side depends on the browser that's running it, so you could use async if it's supported in your coworkers browsers.
The server-side Javascript runs on Rhino (not sure of the version) which is different from Node.js and plays a bit more like a browser environment with no access to window. Certain limitations are placed on the backed (no XMLHTTPRequest, instead, you have to use one of their builtin methods, etc).
Just to update everyone: As of Suitescript 2.1 ES9 is supported so now you can have serverside promises and async/await.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With