Hello everyone, I was playing around with arguments on this challenge and I got strange result when passing negative -1 and positive 1. On freecodecamp the rusult is 5. Tried same code on my phone and got 0 as it should be.
The difference works not as I expected also: functionWithArgs(1, -1) with console.log(x -y) results in 2, which is TRUE; (-1, 1) => -2, also TRUE; but (-1, -1) => 5;
What’s the catch here? Thanks.
function functionWithArgs(x, y) {
console.log(x + y);
}
functionWithArgs(1, -1);