Default Function Parameters

suggest change
function addTwo(a, b = 2) {
    return a + b;
}

addTwo(3) // Returns the result 5

With the addition of default function parameters you can now make arguments optional and have them default to a value of your choice.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents