Default Function Parameters
suggest changefunction 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.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents