title: Assigning alias to object passed as parameter to function in Javascript
body: <p>In this function I have this object <code>{ email, password }</code> passed to it</p>
  
  <pre><code>static login = ({ email, password }) =&gt; {
          const body = { email, password };
          callApi(body);
  }
  </code></pre>
  
  <p>So to access the whole object I need to re-assign the values to the object 'body' in my case. Can't I access the whole object some other way something like this </p>
  
  <pre><code>static login = (body : { email, password }) =&gt; {
          callApi(body);
  }
  </code></pre>
  
  <p>so I don't have to re-assign it.</p>