title: Confused console.log is outputting a sorted array before the sort operates on it
body: <p>Baffled as to why both console.logs output a sorted array. It's as if both console.log lines are being run at the end of the script. I was expecting the first console.log to output the unsorted array!? If I comment out the sort the array appears unsorted in the initial console output.</p>
  <pre><code>const notes=[
      {title: '2. My Next Trip', 
       body: 'I would like to go to Spain...'}, 
      {title: '3. Habits to Work On', 
       body: 'Exercise. Eating a bit better'}, 
      {title: '1. Office meditation', 
       body: 'Get a new seat'}
  ]
   
  console.log(`Unsorted Array : `, notes)
  
  notes.sort((a, b)=&gt;{
      if(a.title &lt; b.title) return -1
      else if(a.title &gt; b.title) return 1
      else return 0
  })
   
  console.log(`Sorted Array : `, notes)
  </code></pre>
  <p><img src="https://i.stack.imgur.com/c7bxZ.jpg" alt="enter image description here" /></p>