Skip to content

Instantly share code, notes, and snippets.

/**
* This polyfill is used where the Uint8Array.fill is not available on given platform.
* It will port the Array.fill function to Uint8Array.fill. So, when Uint8Array.fill is called,
* then the implementation of Array.fill will be invoked.
*
* @platfroms IE11, Safari, Android for React Native Apps.
* @author Mozilla Development Network
*/
if (!Uint8Array.prototype.fill) {
Object.defineProperty(Array.prototype, 'fill', {