title: Partial destructuring of object in function arguments in JavaScript
body: <p>Is there a way to destructure only some object properties in function arguments, while the rest would remain accessible in the object?</p>
  
  <p>Consider the following react example. (I am using React as an example, but this question is applicable for JS in general) </p>
  
  <pre><code>const Form = (formProps) =&gt; {
    return (
      ...
      &lt;FormSectionComponent
         initialValues={...} 
         values={...}
         {...formProps}
      /&gt;
      ...
    )
  }
  
  const FormSectionComponent = ({ initialValues, values}) =&gt; {
  ...
  }
  </code></pre>
  
  <p>The incoming <code>props</code> are destructured in function arguments, however, there are other props coming in that I might want to access at some condition and which I do not want to or cannot destructure - for example I do not know what they are and would like to log them.</p>
  
  <p>Is there a way not destructure the other props  in the argument section and access them as a <code>props</code> object?</p>
  
  <p>The only workaround I can think of is this:</p>
  
  <pre><code>const FormSectionComponent = (props) =&gt; {
    const { initialValues, values} = props;
  }
  </code></pre>
  
  <p>But I wonder if there is any other solution.</p>