title: Javascript/Typescript array.map function is changing the value of a variable defined before the .map
body: <p>I am playing around with some react code, and observed unexpected (to me) behaviour. Can someone please explain whats going on?</p>
  
  <pre><code>export default function AnswerBox(props: any) {
      const before = props.answers;
      console.log('const before ', before);
      props.answers.map((value: any) =&gt; {value.selected = 'asdfasdfasdf'})
      console.log('answer props after' , props.answers);
  </code></pre>
  
  <p>Both of the log lines show an array of objects with 'selected':'asdfasdfasdf'</p>
  
  <p>Is there some tricky async business I'm missing here? Thanks in advance.</p>