title: Why is my map() with spread syntax not working?
body: <p>I'm really not seeing where this is going wrong. I've seen posts of this particular example from O'Reilly's Learning React, by Banks &amp; Porcello. However, the posts seem to work fine, but my example does not. If I have a typo, I don't see it. Where's my flaw? I don't know why I get a null string value instead of "HB Woodlawn"</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
    &lt;script type="text/babel"&gt;
  
      // Editing one object in an array of objects
  
      let schools = [
        {name: 'Yorktown'},
        {name: 'Stratford'},
        {name: 'Washington &amp; Lee'},
        {name: 'Wakefield'}
      ];
  
      const editName = (oldName, newName, arr) =&gt;
        arr.map(item =&gt; {
          if (item.name === oldName) {
            return {
              ...item,
              name
            }
          }
          else {
            return item
          }
        });
  
      let updatedSchools = editName('Stratford', 'HB Woodlawn', schools);
  
      console.log(updatedSchools[1]);  // name: ""
      console.log(schools[1]);  // name: "Stratford"
  
    &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>