- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 10:42 AM
Why 'the keyword 'const' is reserved' ?
if can't use 'const', what can we use instead?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 11:12 AM
Hi,
As of now, ES6 is not support, we're still on ES5, so you'd want to use: var
var sysID = current.getValue('sys_id');
For example. Same with 'let'. You'd want to use the ES5 equivalent.
May want to seek out your peers at Accenture for their styling guide, etc.
There's word that in the next release of ServiceNow, "Tokyo", that ES6 and even higher features will be support, but for now, it's still ES5.
They've said: "We are targeting features from ES6 up to ES12 (ECMAScript 2021). We will have more to announce as the internal engineering is completed and documentation is finalized. Thank you all for your patience over the years and we look forward to getting your feedback once this is released."
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 10:44 AM
Hi Kartik,
Rather than const, you can use var.
Mike

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 11:12 AM
Hi,
As of now, ES6 is not support, we're still on ES5, so you'd want to use: var
var sysID = current.getValue('sys_id');
For example. Same with 'let'. You'd want to use the ES5 equivalent.
May want to seek out your peers at Accenture for their styling guide, etc.
There's word that in the next release of ServiceNow, "Tokyo", that ES6 and even higher features will be support, but for now, it's still ES5.
They've said: "We are targeting features from ES6 up to ES12 (ECMAScript 2021). We will have more to announce as the internal engineering is completed and documentation is finalized. Thank you all for your patience over the years and we look forward to getting your feedback once this is released."
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2022 01:39 PM
In the next release Tokyo, planned for Q4 2022 we'll support ES6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2024 01:39 AM
Hello Marc,
and the arrow function? For example this code below funzioniert?
Example:
const test = ()=>{alert('Hello')};
test();