Skip to content

Instantly share code, notes, and snippets.

@brettz9
Last active December 9, 2020 01:42
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save brettz9/4212262 to your computer and use it in GitHub Desktop.
Save brettz9/4212262 to your computer and use it in GitHub Desktop.
Array.from polyfill (see also https://github.com/mathiasbynens/Array.from )
/**
* @license MIT, GPL, do whatever you want
* @requires polyfill: Array.prototype.slice fix {@link https://gist.github.com/brettz9/6093105}
*/
if (!Array.from) {
Array.from = function (object) {
'use strict';
return [].slice.call(object);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment