Not one of the three solution options fails the tests, while in node (even in the browser’s devTools) everything works fine!
function countPositivesSumNegatives(input) {
// your code here
let result = [], positive = 0, negative = 0;
if (arguments.length > 1 && arguments != null) {
for (let i of arguments){
if (i > 0 && i !==0) positive++;
if (i < 0 && i !== 0) negative+=i;
}
result.push(positive,negative);
take a five, bruh :D
Those 3 solutions are wrong, why are you using the spread operator? Not a kata issue. Read this too: https://docs.codewars.com/training/troubleshooting#post-discourse
The
ISSUE
label is for provable kata issues. Please use theQUESTION
label when asking for help. See https://docs.codewars.com/training/troubleshooting#post-discourseYour "uknown error" is one the most common errors in JavaScript and it's a problem with your code. Not a kata issue.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Not one of the three solution options fails the tests, while in node (even in the browser’s devTools) everything works fine!
function countPositivesSumNegatives(input) {
// your code here
let result = [], positive = 0, negative = 0;
if (arguments.length > 1 && arguments != null) {
for (let i of arguments){
if (i > 0 && i !==0) positive++;
if (i < 0 && i !== 0) negative+=i;
}
result.push(positive,negative);
}