freeCodeCamp Challenge Guide: Typed Arrays

Typed Arrays

Problem Explanation

  • In this challenge, first we need to create a buffer of 64 bytes. We can use ArrayBuffer() constructor.
  • After creating a buffer we need to create an Int32Array, for that we can use Int32Array() constructor.


Solution 1 (Click to Show/Hide)
//Create a buffer of 64 bytes
var buffer = new ArrayBuffer(64);

//Make 32-bit int typed array with the above buffer
var i32View = new Int32Array(buffer);

Relevant Links

1 Like