How to use options object in functions?
3 min readJan 19, 2019
Standard way of creating functions and passing parameters is simply to declare a function name and list parameters in the bracket:
function foo(param) {
// do something
}
This works well and there is absolutely nothing wrong with such a function.
However, when we pass more parameters to our function and/or we start adding optional…