ES6 functionality

Does not apply to latest Totara versions

This page only applies to Totara 16 and earlier. Totara 17 dropped IE support, and Totara 18 removed the polyfills completely.

In Totara 17, all JS features are available so long as they are natively supported by all supported browsers.

Totara supports a small set of ES6 and later features despite the fact that not all of our supported browsers provide there features natively. We achieve this by using a combination of core-js polyfills and those provided on https://developer.mozilla.org.

All ES6+ polyfils have been added to lib/javascript_polyfill/src/ and are included on every page when using IE11.

Available polyfills

PolyfillFunctional overviewImplementationAvailable since Totara version

Array.find

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findcore-js13
Array.findIndexhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndexcore-js13
Array.fromhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fromcore-js14
Array.includeshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includescore-js13
CustomEventhttps://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEventOn MDN overview page12
Element.closesthttps://developer.mozilla.org/en-US/docs/Web/API/Element/closestOn MDN overview page12
Element.matcheshttps://developer.mozilla.org/en-US/docs/Web/API/Element/matchesOn MDN overview page12
Element.removehttps://developer.mozilla.org/en-US/docs/Web/API/ChildNode/removeOn MDN overview page12
Fetch APIhttps://developer.mozilla.org/en-US/docs/Web/API/Fetch_APIhttps://github.com/github/fetch12
Maphttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Mapcore-js14
NodeList.forEachhttps://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEachcore-js13
Number.isFinitehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinitecore-js13
Number.isIntegerhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isIntegercore-js13
Number.isNaNhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaNcore-js13
Number.parseFloathttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseFloatcore-js13
Number.parseInthttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseIntcore-js13
Object.assignhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assigncore-js12
Object.createhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/createcore-js14
Object.entrieshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entriescore-js13
Object.valueshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valuescore-js13
Promisehttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promisehttps://github.com/stefanpenner/es6-promise12
Sethttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Setcore-js14
String.startsWithhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWithcore-js12
String.endsWithhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWithcore-js12
String.fromCodePointhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePointcore-js14
String.includeshttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includescore-js13