Skip to content

Instantly share code, notes, and snippets.

@JamesKyburz
Created October 19, 2012 13:43
Show Gist options
  • Save JamesKyburz/3918303 to your computer and use it in GitHub Desktop.
Save JamesKyburz/3918303 to your computer and use it in GitHub Desktop.
Typed array polyfil
!function(global) {
var typedArrays = ['Int8Array', 'Uint8Array', 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', 'Float64Array'];
for(var i=0; i < typedArrays.length; i++) {
if(typeof global[typedArrays[i]] === 'undefined') {
global[typedArrays[i]] = Array;
}
}
}(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment