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 = () => stats.max + stats.min / 2.0;
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.5993.731 YaBrowser/23.11.1.731 Yowser/2.5 Safari/537.36
Challenge Information:
ES6 - Use Destructuring Assignment to Pass an Object as a Function’s Parameters
Has anyone solved this problem, why is it so complicated? Of course, I understand that no one here can explain why this nonsense is needed, but which newbie can do it himself?
спользуйте деструктирующее присваивание внутри аргумента функции half для отправки только max и min внутри функции.
I rarely understand instructions, as the task is described here, I don’t understand anything here
It doesn’t work because you are using stats which is not a function argument. You’re ignoring the function arguments and just sticking them in at the end. You have to use them in place of where the old argument was used.
These codes do the same thing, so you use name, age, nationality, location the same way as you would with destructuring inside of the function body. Do you know what destructuring does?
I don’t know where might work better for you, but this forum isn’t the place to be insulting towards people who are writing this curriculum for free.
I definitely get feeling frustrated, but we really are trying to make these lessons work for as many people as possible. Learning code is really, really hard to do. It’s totally normal to struggle and feel frustrated.
I do really think that your translation app isn’t doing a very good job accurately translating the meaning of the text.
my code somehow finds a statistics object, or rather a function, with two arguments in the values, then in the body of the function it adds min max and divides by 2, after which it needs to return the result