1

When writing JavaScript logic in a Lightning Component controller or helper using the ECMAScript 6: maps and sets would lead to cleaner code in some cases.

There is mention of Map and Set in this Lightning Components Collection Types documentation but that may be conceptual (or be related to Apex types). This Salesforce Lightning CLI Rules Validate JavaScript Intrinsic APIs (ecma-intrinsics) documentation links to ECMAScript documentation that includes Map and Set.

Map and Set are available in Chrome. But can I assume they available anywhere a Lightning Component can run?

PS

This asks a similar but broader question ECMAScript2015 compatibility and does not have an accepted answer.

3

Maps, Sets, Weakmaps and Weaksets are all supported by Lockerservice even though they don't have any official documentation explicitly stating so. You can check their SecureWindow compatibility table and note that the actual columns for Browser API and Locker API both state function instead of Not To Be Supported.

  • Thanks should have looked there. Can you confirm that the supported browsers all support Map and Set? – Keith C May 3 '17 at 21:20
  • Browser support is good enough for Map and Set except for IE 11 which has partial support. – Chirag Bhatia - chirag64 May 4 '17 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.