Skip to content

Instantly share code, notes, and snippets.

@mrspeaker
Created November 23, 2010 12:22
Show Gist options
  • Save mrspeaker/711667 to your computer and use it in GitHub Desktop.
Save mrspeaker/711667 to your computer and use it in GitHub Desktop.
JavaScript typed array on iOS 4.2.1
<script type="text/javascript" charset="utf-8">
var buffer = new ArrayBuffer( 16 );
var int32View = new Int32Array( buffer );
for ( var i = 0; i < int32View.length; i++ ) {
int32View[i] = i * 2;
}
alert( int32View[ 3 ] ); // Alerts 6 in 4.2.1
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment