title: Array map function doesn't change elements
body: <p>In JavaScript, I have an array, which is</p>
  <pre><code>array = [true, false]
  </code></pre>
  <p>In some cases, I am trying to initialize this array</p>
  <pre><code>array.map(item =&gt; {
     item = false
  })
  </code></pre>
  <p>After running the above code, the array is not changed, it is still <code>[true, false]</code>, so is <code>.map</code> not reliable sometimes?</p>
  <hr />
  <p>ONE MORE QUESTION:
  After running my below code, the array is changed. Why does it work in this case?</p>
  <pre><code>let array = [{id:1, checked: false}, {id:2, checked:true}]
  array.map(item =&gt; {
      item.checked = true
  })
  </code></pre>
  <p>array becomes <code>[{id:1, checked: true}, {id:2, checked:true}]</code></p>