title: Where to use ArrayBuffer vs typed array in JavaScript?
body: <p>I am moving from Node.js to browser environment, and I am still confused over ArrayBuffer vs. typed arrays (such as Uint8Array).</p>
  
  <p>I am confused over where to use the typed arrays, and where to use ArrayBuffer directly. It's not hard to convert one to the other and vice versa, but which to use when?</p>
  
  <p>For example, when I am creating an object that will represent a chunk of data in my code, should it be ArrayBuffer or Uint8Array? What does it depend on?</p>
  
  <p>Or: should I rather return <code>ArrayBuffer</code> from my functions (for example, for external API), or the typed arrays? </p>
  
  <p>Note that I can google how exactly to add elements etc to those typed arrays; what I am missing is some short general guide what to use where. Especially when moving from node's Buffer.</p>