title: False statement returns an empty array
body: <p>So I am trying to write a code where if there a duplicate numbers it returns true and if there isn't duplicates it returns false.  I get the duplicates to show up but I want it to return the word false if there aren't duplicates.  Here is the code what am I missing.</p>
  
  <pre><code>var numbers= [14, 50, 27, 52,  41, 5, 9, 25, 10, 6];
  
  var uniqueArray = numbers.map((number) =&gt; {
  return {count:1, number: number}
  })
  .reduce((a, b) =&gt; {
  a[b.number] = (a[b.number] || 0) + b.count
  return a
  }, {})
  
  var duplicate = Object.keys(uniqueArray ).filter((a) =&gt; uniqueArray [a] &gt; 1)
  
  //console.log(duplicate)
  
  function hasDuplicates(){
    if (duplicate = true) {
      return true
    }
  }
  </code></pre>