Need assistance in set-default-parameters-for-your-functions

Challenge Name

set-default-parameters-for-your-functions has an issue.

Issue Description

Browser Information

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36.

Screenshot

Your Code


"use strict";
function increment(number, value = 1) {
    return number + value;
}
console.log(increment(5, 2)); // returns 7
console.log(increment(5)); // returns NaN 

Is it worth to create a new topic on such problems?

console.log(increment(5)); // returns NaN 

this line should be

console.log(increment(5)); // returns 6
1 Like

Thanks for the report. I think the reason behind the original comment is to show what the return value is at the time you start the challenge, not what the function should return.

Oh, I got it, thanks