The test is failing because you’re asked to modify the existing function, not to create your own ^^
It doesn’t mean your one is worse or something like that, simply the code has to pass some tests in order to be checked and if you change the original code this could mess something up with the test ^^
Since you have a correct function but is not matching with the test i’ll give you a correct one ( that will pass the tests) down below: i will suggest you to try to reset your code and modify the existent function though ^
const sum = (function() {
“use strict”;
return function sum(…args) {
// const args = [ x, y, z ];
return args.reduce((a, b) => a + b, 0);
};
})();
console.log(sum(1, 2, 3)); // 6