title: Return the Array of Bytes from FileReader()
body: <p>I need some help returning the "bytes" variable from this function below to be used as input in another function.</p>
  
  <pre><code>function openfile() {
  var input = document.getElementById("files").files;
  var fileData = new Blob([input[0]]);
  
  var reader = new FileReader();
  reader.readAsArrayBuffer(fileData);
  reader.onload = function(){
      var arrayBuffer = reader.result
      var bytes = new Uint8Array(arrayBuffer);
      console.log(bytes);
  }
  </code></pre>
  
  <p>I'd like to get the return of the above function and use the array of bytes as input parameter in another function.</p>