Closed Bug 1360661 Opened 7 years ago Closed 4 years ago

Document for Array.from provides a polyfill that cannot create array from a Set

Categories

(Developer Documentation Graveyard :: JavaScript, enhancement, P5)

All
Other
enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: fanqi1234, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

Examples from the same document page suggest that Array.from should be able to create an array from a Set.

However, the document page provides a polyfill that only handles arrayLike with a .length property.

With the provided polyfill, Array.from(anySet) is always empty.


Comparison:
https://jsfiddle.net/fanqi1234/esratk8w/
A polyfill which does work is on github at https://github.com/Financial-Times/polyfill-service/blob/master/polyfills/Array/from/polyfill.js (MIT licence)
found the link above did not actually work in IE11 & forked and altered the pollyfill at https://github.com/mcshaz/polyfill-service/blob/master/polyfills/Array/from/polyfill.js
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.