You have to use the rest operator so that the function can take any number of arguments. If you use (x, y, z) then there will only ever be three arguments.
We need a function sum, that can take any numbers of args. Instead of sum parameters x, y, z we can use a rest operator: sum(…args). After that we don’t need to introduce any array containing that three members x, y and z and we should delete that line with const args.