title: Remove square bracket([ ]) in json file node JS
body: <p>I want to remove square bracket "[ ]" in json object or concatenate some array of object to one array of object.</p>
  
  <p>This code for counting current stock </p>
  
  <pre><code>currentStock : ( req, res, next) =&gt; {
  
      var listed_item = _(arr_items).map( (z) =&gt; {
  
          var result = module.exports.getTransactionAfterDate(z.created_at, z.item_id);
  
          return result;
  
      })
  
      var jsonContent = JSON.stringify(listed_item);
  
      return res.send(jsonContent);
  },
  
  
  getTransactionAfterDate : (date, item_id) =&gt; {
  
      var result = _(db_transaction).filter( (x) =&gt; {
  
          return x.created_at &gt; date &amp;&amp; x.item_id == item_id;
  
      });
  
      return result;
  
  }
  </code></pre>
  
  <p>this is "listed_item" json result </p>
  
  <pre><code>[
      [{
          "id": 30608,
          "item_id": "A01001",
          "quantity": 150,
          "status": "OUT",
          "created_at": "2020-02-10 16:11:51",
      }],
      [],
      [{
          "id": 30412,
          "item_id": "A02001",
          "quantity": 53,
          "status": "OUT",
          "created_at": "2020-02-06 14:44:20",
      }, {
          "id": 30482,
          "item_id": "A02001",
          "quantity": 33,
          "created_at": "2020-02-07 15:26:50",
          "updated_at": "2020-02-07 15:26:50",
      }]
  ]
  </code></pre>
  
  <p>what i want is like this</p>
  
  <pre><code>[
      {
          "id": 30608,
          "item_id": "A01001",
          "quantity": 150,
          "status": "OUT",
          "created_at": "2020-02-10 16:11:51",
      },
      {
          "id": 30412,
          "item_id": "A02001",
          "quantity": 53,
          "status": "OUT",
          "created_at": "2020-02-06 14:44:20",
      }, {
          "id": 30482,
          "item_id": "A02001",
          "quantity": 33,
          "created_at": "2020-02-07 15:26:50",
          "updated_at": "2020-02-07 15:26:50",
      }
  ]
  </code></pre>
  
  <p><strong>note</strong>
  i tried concatenate "getTransactionAfterDate" inside "arr_items" map to join all array inside</p>
  
  <pre><code>var temp = [];
  var listed_item = _(arr_items).map( (z) =&gt; {
  
      temp = _(temp).concat(module.exports.getTransactionAfterDate(z.created_at, z.item_id));
      var result = temp;
  
      return result;
  
  })
  </code></pre>
  
  <p>but the result is empty array</p>
  
  <pre><code>[ [], [], [] ]
  </code></pre>