Keeping things light today, we’re going to talk about default parameters in Javascript. When building software there is a need to have an ensured level of quality and assumption of continued functioning at all times. Missing passing in a parameter into a function call breaks the flow of the application and sends an error to the end-user. Default parameters resolve that by having a default value present, just in case one isn’t passed. Let’s look at some code!

const method = (a, b = 1) => a + b;

method(3);   // returns 4
method(2,5); // returns 7