title: Remove an element from JSON using NODEJS
body: <p>I have a json file and I'm trying to remove an element with below code .</p>
  
  <pre><code> exports.delete = function(req, res) {
        var deletearticle = articles[req.params.id];
        delete articles[req.params.id];
        fs.writeFile('server/articles.json',JSON.stringify(articles, null, 4),finished);
            function finished(err){
                   console.log("---&gt;After deletion, article list:\n" + JSON.stringify(articles, null, 4) );
                                  }
       res.end(JSON.stringify(deletearticle, null, 4));
  };
  </code></pre>
  
  <p>after removing the element my json file will be like : </p>
  
  <pre><code>[
      {
          "header": "Jack",
          "body": "Davis",
          "date": "",
          "id": 0
      },
      null,
      {
          "header": "dfd",
          "body": "dgfgfgfgfdgfg",
          "date": "2018-11-24T16:33:48.842Z",
          "id": 2
      }]
  </code></pre>
  
  <p>and I get error on client side :</p>
  
  <pre><code>  {articles ? articles.map(({ id, header ,body}) =&gt; (
            &lt;div key={id} timeout={500} className="fade"&gt;
             &lt;div className="article"&gt;
                        &lt;h2 className="article_title"&gt;{header}&lt;/h2&gt;
  </code></pre>
  
  <p>Because one of my JSON's element is null it says that can't read id from null.Is There any better way to remove this element from my json file ? or i can check if srticle is not null in client side.</p>