title: I want to convert This array to this object
body: <pre><code>const movies = [
    { name: &quot;Escape from Pretoria&quot;, year: 2020 },
    { name: &quot;Good Will Hunting&quot;, year: 1997 },
    { name: &quot;The Matrix&quot;, year: 1999 },
    { name: &quot;Tarzan&quot;, year: 1999 },
    { name: &quot;Titanic&quot;, year: 1997 },
    { name: &quot;The Imitation Game&quot;, year: 2014 },
  ];
  </code></pre>
  <p>to object like this</p>
  <pre><code>const x = {
    1997: [&quot;Good will Hunting&quot;, &quot;Titanic&quot;],
    1999: [&quot;The Matrix&quot;, &quot;Tarazan&quot;],
    2014: [&quot;The Imitation Game&quot;],
    2020: [&quot;Escape from Pretoria&quot;],
  };
  
  </code></pre>
  <p>Using reduce() or another way .. thank you!</p>