title: How to edit local JSON file with JavaScript
body: <p>Please answer me as example <code>Select</code> code</p>
  
  <ol>
  <li>I want to add values into array local file JSON (insert member to JSON)</li>
  <li>element is also replaced my element like <code>type</code>, <code>name</code>... in JSON (update member in JSON)</li>
  <li>delete number line where <code>id="1"</code> and <code>email="amir@site.com"</code> (delete memebr in JSON)</li>
  </ol>
  
  <p>JSON file : <code>report.json</code></p>
  
  <pre><code>var amir='{"reports":[' +
      '{"id": "1","type": "admin","name": "amir","email": "amir@site.com","password": "123"},' +
      '{"id": "2","type": "member","name": "kevin","email": "ad@ad.com","password": "1234"}]}';
  </code></pre>
  
  <p>example <code>select</code> code for check register admin :</p>
  
  <pre><code>var obj = JSON.parse(amir);
  for(c = 0; c &lt;= obj.reports.length - 1; c++) {
      type = obj.reports[c].type.toString();
      if (type == "admin") {
          active = 1;
      }
  
      if (c == obj.reports.length - 1) {
          if (active == 1)
              alert("Yes");
          else
              alert("No");
      }
  }
  </code></pre>