It seems that some browsers (IE10) do not support Uint8ClampedArray
, and if this is the function you are going to use, you can just check it
if ( 'Uint8ClampedArray' in window ) { ...
If the check returns false, arrays with arrays and / or are not supported.
If you do not need Uint8ClampedArray
, you can stick with what you have, personally I like to use in
if ( 'ArrayBuffer' in window ) { ...
source share