The destructing is not exclusive to just the stats object. The destructing will work any time you call this half function with an object that has the max and min properties.
in the code snippet, only the object is declared and the function body, the function isnt called. To call the function you pass properties(if it requires such). In the case it is designed to work with an object which has keys named “min” and “max”.
You can do as follow: