Problem with destructuring ES6 Object

Tell us what’s happening:
I can’t understand the probleme here… i wrote my code, it seemed okay since the console says “destructuring was used” but the validator says “destructuring was not used”… I’m a bit confused…

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
};
const half = (function() {
  "use strict"; // do not change this line

  // change code below this line
  return function half(stats) {
    // use function argument destructuring
    const {max, standard_deviation, median, mode, min, average} = stats;
    return (max + min) / 2.0;
  };
  // change code above this line

})();
console.log(stats); // should be object
console.log(half(stats)); // should be 28.015

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:

The console on the bottom right is a little confusing and is being redesigned. Basically, it will show the test which IS failing in the console which is being correctly reported in the tests section.

While you are technically using object destructuring inside the function, the instructions, are:

Use destructuring assignment within the argument to the function half

The argument is the part where stats sits as the parameter of the function named half. The challenge example shows exactly how to do this.

Thank you for your answer.

Okay, I figured it out for the console as the text was the exact same as in the validator.

For the rest, I overthinked the instructions.
Than you, have a nice day =).