// Change values below to test your code
abTest(-2,2);
See i got see below wrong
abTest(-2,2) should return undefined
abTest(2,-2) should return undefined
But just to add: Since apparently the test specifically asks for ‘undefined’ to be returned in those cases, it would be good practice to actually return that ‘undefined’ explicitly, i.e.:
if(a<0 || b<0){
return undefined;
}
This helps readability of your code. People will know that you really do intend to return undefined.