title: Use Destructuring Assignment to Pass an Object as a Function's Parameters
challengeType: 1
---
## Description
<sectionid='description'>
In some cases, you can destructure the object in a function argument itself.
Consider the code below:
<blockquote>const profileUpdate = (profileData) => {<br> const { name, age, nationality, location } = profileData;<br> // do something with these variables<br>}</blockquote>
This effectively destructures the object sent into the function. This can also be done in-place:
<blockquote>const profileUpdate = ({ name, age, nationality, location }) => {<br> /* do something with these fields */<br>}</blockquote>
This removes some extra lines and makes our code look neat.
This has the added benefit of not having to manipulate an entire object in a function; only the fields that are needed are copied inside the function.
</section>
## Instructions
<sectionid='instructions'>
Use destructuring assignment within the argument to the function <code>half</code> to send only <code>max</code> and <code>min</code> inside the function.
</section>
## Tests
<sectionid='tests'>
```yml
- text: <code>stats</code> should be an <code>object</code>.