title: how can i push data outside web3.eth.sendSignedTransaction to an array
body: <p>I want to push data outside web3.eth.sendSignedTransaction what is the correct way to do something like this:</p>
  
  <pre><code>let somearray = [];
  
    web3.eth.sendSignedTransaction('0x'+transaction.serialize().toString('hex'))
              .on('transactionHash',function(hash){
                 console.log("thash: " + hash);
              }).on('confirmation', (confirmationNumber) =&gt; {
  
                console.log('transferToReceiver confirmation: ' + confirmationNumber);
                if(confirmationNumber == 1){
  
                  somearray.push("Transaction Confirmed");
  
                }
  
              });
  console.log(somearray[0]);
  </code></pre>