Skip to content

Instantly share code, notes, and snippets.

@brettz9
Last active December 9, 2020 01:42
Show Gist options
  • 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