Tell us what’s happening:
Hi guys,this code works just fine but the thing is when i write it in VS it sends me a message that All destructured elements are unused.though the result is correct.Can anyone tell me what’s wrong with my code ?
Your code so far
"use strict";
const stats = {
max: 56.78,
standard_deviation: 4.34,
median: 34.54,
mode: 23.87,
min: -0.75,
average: 35.85
};
const half = ({max,min}) =>{
return (stats.max + stats.min) / 2.0;
};
console.log(stats); // should be object
console.log(half(stats)); // should be 28.015
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-to-pass-an-object-as-a-functions-parameters/