For starters the length of the collections is static, and the values that the collections can hold is restricted to number values. The number values are also restricted depending on the kind of typed array, for example a unit8 array is restricted to a one byte number range between 0 and 255. So these typed arrays are not a replacement for regular javScript arrays that do not have these restrictions and cand gold any kind of value, but they come in handy when working with binary data.
So then typed arrays they are helpful when working out something that is an underlaying binary data buffer value of some kind for one thing. The reason why is because of the fixed size, and the fact that values are restricted to numbers only, and on top of that additional rules for the integers depending on the kind of typed array. For example there is both clamped and un-clamped versions for many of these typed arrays that has to do with value the exceeded the number range, that is clamping values so that a value higher then 255 end up being 255 or allowing for the value to wrap around and work out to what is left when dividing.
In this post I will be looking mainly at the Unit8Array constructor, but much of what is written here can be applied to other type array constructors.
To create a Uint8Array call the constructor with the new keyword, and pass an argument that will be the number of elements for the array. Once there is an instance of this kind of typed array, I can then set byte values for it by using the bracket syntax just like that of a regular array. When setting a value to it that is a number values will be converted to a number range between 0 and 255.
There is a Uint8ClampedArray constructor the only difference between this and the plain Uint8Array constructor seems to be that values are clamped rather then warped when they go out of range.
Most clients will support the typed array from method that works in a similar way tot hat of the Array from method. That is it is a static method of the Unit8Array constructor or any type array constructor that can be used to create a new typed array from a regular array like object.
So unit8 arrays are a way of having an array of number values that range between 0 and 255 making it an appropriate options when it comes to anything that has to do with raw binary data. So any project that will need to work with data in a raw binary from a tyoe array might be a good choice as it will enforce rules for the elements that are appropriate for this kind of application. There might be some cross browser concerns when it comes to front end development though on cretin platforms, but if you are suing a late version of node then there should be little to no problem just working with theme there of course.