title: React array.slice multiple endpoints
body: <p>Is it possible to get first 3 and last 2 items using array.slice in js</p>
  <p>I want to render all data if user is AUTH, and if not I want first 3 and last 2 from array without recreating array.</p>
  <pre><code> {menu.slice(...(auth ? [0, 5] : //THERE SHOULD FIND FIRST 3 AND LAST 2 )).map((item) =&gt; (
        &lt;Link
          onClick={() =&gt; dispatch(handleMenu())}
          to={item.path}
          className={`${auth === false &amp;&amp; &quot;font-md&quot;} ${
            item.path === window.location.pathname &amp;&amp; &quot;font-2xl&quot;
          }`}
        &gt;
          {item.title}
        &lt;/Link&gt;
      ))}
  </code></pre>