ES6 and ServiceNow (const, let and var)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2019 06:43 PM
Why does 'const' get processed but 'let' does not?
Both are supported in ES6 and not in ES5. The following are run in a background script.
For example:
const object1 = {
a: 'somestring',
b: 42,
c: false
};
Prints:
*** Script: a,b,c
Yet,
let object1 = {
a: 'somestring',
b: 42,
c: false
};
Prints:
Javascript compiler exception: let is an ECMAScript 6 feature - not supported (null.null.script; line 1) in:
let object1 = {
a: 'somestring',
b: 42,
c: false
};
The assumption here is that 'const' would not get processed by the JS engine as it's a part of ES6 functionality which is not supported by ServiceNow.
Thoughts?
- Labels:
-
Best Practices
- 8,395 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2019 03:29 PM
Yea, I wouldnt hold your breath. I still feel like we just only got ES5 not too long ago (been 2-3 years now), but at that time it was still 5-6 years out of date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2021 08:36 AM
and here we are still without ES6

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 06:11 AM
This is a tall order. I agree it should happen but we're at the mercy of when ServiceNow does this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 06:16 AM
Yea absolutely a tall order, but while we are making requests can we get a modern bootstrap?