If your value is smaller than the Typed Array unit than just store the value into the array, eg you have 23453.342 and using Float64, then just put it into the array
var view = new Float64Array(1);
view[0] = 23453.342;
Now if you are wanting to convert a number into its individual bytes,eg a 32bit number and get the 4 bytes that make it, you can use two TypedArray views. Put your value into the higher bit array, and read the bytes from the lower unit array.
//The argument passed to ArrayBuffer constructor
//is number of Bytes the buffer should be
var buff = new ArrayBuffer(4);
//Since buffer was made for 4 bytes, this view can read/store 1 32bit value
var view = new Uint32Array(buff);
//buffer still has 4 bytes, so this view can read/store 4 8bit values
var view2 = new Uint8Array(buff);
view[0] = 123456;
console.log(view2);
If you want to manually get the bytes, or do not have access to a higher unit typed array, than you can use the bit shifting and bitwise AND operators to get the individual bytes
var i = 123456;
var buff = new ArrayBuffer(4);
var view = new Uint32Array(buff);
var view2 = new Uint8Array(buff);
view2[0] = i & 0x000000FF;
view2[1] = (i & 0x0000FF00) >> 8;
view2[2] = (i & 0x00FF0000) >> 16;
view2[3] = (i & 0xFF000000) >> 24;
console.log( view2, view[0] );
As for getting the values back out, in the case of using the two typed arrays, you just read the array of the target unit. In this case read from the Uint32Array
var buff = new ArrayBuffer(4);
var view = new Uint32Array(buff);
var view2 = new Uint8Array(buff);
view2[0] = 64, view2[1] = 226, view2[2] = 1, view2[3] = 0;
var i = view[0];
console.log(i);
Again if you want to use the bit shifting way, you need to shift each byte from the smaller typed array and bitwise OR them together.
var buff = new ArrayBuffer(4);
var view = new Uint8Array(buff);
view[0] = 64, view[1] = 226, view[2] = 1, view[3] = 0;
var i = 0;
i |= view[3] << 24;
i |= view[2] << 16;
i |= view[1] << 8;
i |= view[0];
console.log(i);