title: How to find non repeated numbers in an Array using JavaScript?
body: <p>Dear all I'm trying to find non repeated value in an array using javascript.I have written some code but it not working properly ..can you guys tell me where is the problem.thanks.     </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var arr = [-1, 2, 5, 6, 2, 9, -1, 6, 5, -1, 3];
  var n = arr.length;
  var result = '';
  
  function nonrep() {
    for (var i = 0; i &lt; n; i++) {
      var j;
      for (j = 0; j &lt; n; j++)
        if (i != j &amp;&amp; arr[i] == arr[j]) {
          result = arr[i];
          break;
        }
      if (j == n)
        return arr[i];
    }
    return result;
  }
  console.log(nonrep())</code></pre>
  </div>
  </div>
  </p>