title: Unable to get all workers in worker block while using cluster in NodeJS
body: <p>I need to get all workers id list in worker block. Here is my example which is not working </p>
  
  <pre><code>const cluster = require('cluster');
  var a = [];
  if (cluster.isMaster) {
    console.log('I am master');
    cluster.fork();
    cluster.fork();
  } else if (cluster.isWorker) {
    a.push(cluster.worker.id);
    console.log(`I am worker #${cluster.worker.id}`);
    console.log(a);
  }
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>I am master
  I am worker #1
  [ 1 ]
  I am worker #2
  [ 2 ]
  </code></pre>
  
  <p>While expected output</p>
  
  <pre><code>I am master
  I am worker #1
  [ 1 ]
  I am worker #2
  [ 1, 2 ]
  </code></pre>