Tell us what’s happening:
This maybe an issue of misunderstanding or a small mistake:
The theory block states the following
const profileUpdate = ({ name, age, nationality, location }) => {
/* do something with these fields */
}
with “the do something with these fields” being inside curly braces.
Yet, when I tried to input my answer in a similar way it was not accepted. It worked when I removed the curly braces. Why is it so? Is it a typo in theory?
Thank you
Your code so far
const stats = {
max: 56.78,
standard_deviation: 4.34,
median: 34.54,
mode: 23.87,
min: -0.75,
average: 35.85
};
// Only change code below this line
const half = ({max, min}) => (max + min) / 2.0
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15
.
Challenge: Use Destructuring Assignment to Pass an Object as a Function’s Parameters
Link to the challenge: