How to use options object in functions?

Arek Jaworski
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…

--

--

Arek Jaworski

Software Architect — AWS/Node.JS/JavaScript Contractor and Tutor. I write about programming, computer science, algorithms and more!