antonpug
antonpug

Reputation: 14296

Does Babel transpile Map to be usable in IE11?

Looking at Map documentation, it looks like it is not fully supported in IE11: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map

Does Babel convert Map.set and Map.get to be functional for IE?

Upvotes: 3

Views: 3051

Answers (1)

rasmeister
rasmeister

Reputation: 1996

The easy part is figuring out what the different transpilers and browsers support. See this link for this information. From this you can see what portion of Map is supported by IE11, for example, and of course, what Babel support is like (quite good for Map with polyfill - see below). Just click on 'Map' in the left column to expand it to a detailed list of capabilities needed to support that feature.

The trick is figuring out what plugins are required by Babel, and according to their documentation, it requires the babel polyfill:

Support via polyfill In order to support Maps, Sets, WeakMaps, and WeakSets in all environments you must include the Babel polyfill.

You can see the babel docs here

Upvotes: 6

Related Questions