JavaScript Mode

  • The JavaScript engine ServiceNow uses to evaluate scripts supports the ECMAScript5 scripting standard
  • To support scripts written prior to the Helsinki release, the JavaScript engine has two modes
    • Compatibility Mode
    • ES5 Standards Mode (default)

ES5 Standards Mode is the default mode when creating new scoped scripts. It supports ECMAScript5 syntax, extensions, and features, including:

  • The 'use strict' declaration.
  • Control over extensibility of objects.
  • Get and set properties on objects.
  • Control over write-ability, configurability, and innumerability of object properties.
  • New Array and Date methods.
  • Native JSON support.
  • Support for modern third-party libraries such as Iodash.js and moment.js.

Compatibility Mode supports ECMAScript3 with ServiceNow behaviors and extensions

  • All Global scripts.
  • All scripts developed prior to the Helsinki release.

results matching ""

    No results matching ""