(ES6) ES6 (2016)

TypedArr (TC02)

   1:  const buffer = new ArrayBuffer(16); // 16 bytes
   2:  const int32View = new Int32Array(buffer); // View as 32-bit integers (4 elements, each 4 bytes, as buffer is 16 byte long)
   3:  const uint8View = new Uint8Array(buffer); // View as 8-bit integers (16 elements)
   4:  
   5:  int32View[0] = 12345;  // Modifies the underlying ArrayBuffer
   6:  console.log(uint8View);  // The Uint8Array reflects the change made through the Int32Array



    Creating Typed Arrays:
        • From an ArrayBuffer:
        
        Uint8Array(16) [
          57, 48, 0, 0, 0, 0,
           0,  0, 0, 0, 0, 0,
           0,  0, 0, 0
        ]





TypedArr context:






ES6 context:




Binary context:



Comments ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19>  <20>  <21>  <22>  <23>  <24>  <25
Link to this page: http://www.vb-net.com/JavascriptES6/TC02.htm
<TAGS>  <ARTICLES>  <FRONT>  <CORE>  <MVC>  <ASP>  <NET>  <DATA>  <TASK>  <XML>  <KIOSK>  <NOTES>  <SQL>  <LINUX>  <MONO>  <FREEWARE>  <DOCS> <TRAVELS> <FLOWERS> <RESUME> < THANKS ME>