title: React js Array and Array Reverse issue without mutating original array
body: <p>I will receive the response from Axios success.</p>
  <p>In this response, I want to save into 2 different constants with normal data and reversed data.</p>
  <p>but while I put console both are showing the reversed ones.</p>
  <p>how can I achieve this?</p>
  <p>slice().reverse() also returning the same array</p>
  <pre><code>const [psresponse, setPSresponse] = React.useState(&quot;&quot;);
  const [trackresponse, setTrackresponse] = React.useState(&quot;&quot;);
  
   axios.get(serverurl)
         .then(function(response) {
               var data = =response.data;
               var reverseddata = data.slice().reverse();
               setPSresponse(reverseddata);
               setTrackresponse(data);
  
               
  
               console.log(reverseddata)
               console.log(response.data)
  });
  </code></pre>
  <p>I want the normal array and the reversed array.</p>
  <p>anyone has an idea pls let me know.</p>