title: How to read json file and filter the result
body: <p>I am stacked since 7 days in a simple function in javascript ... but i can not find the soluction! </p>
  
  <p>The problem is this: I have to read a json file, and filter the result...</p>
  
  <p>This is my server-side script for read the file:</p>
  
  <pre><code>function testing(email) 
  {
      let rawdata = fs.readFileSync('test.json');
      var mydata = JSON.parse(rawdata);
      console.log("parse:"+ mydata);
  
      const value = email;
      const result = mydata.filter(email);
      console.log("result: " + result);
  
      if(result == 'undefined')
      {
          return(false);
      }
      else
      {
          return(true);
      }
  };
  </code></pre>
  
  <p>This is my json file:</p>
  
  <pre><code>[
  {
      "1":"black@gmail.com"
  },
  {
      "2":"bad@gmail.com"
  }
  {
      "3":"strangemail@gmail.com"
  }
  ]
  </code></pre>