How to get size of ArrayBuffer in Javascript

You can get the size of an ArrayBuffer in Javascript usingĀ .byteLength:

var buf = new ArrayBuffer(8);
buf.byteLength // == 8