Or why _.get(object, ['deep', 'prop']) is better than _.get(object, 'deep', 'prop'). Imagine you’re designing a function that accepts a variable number of arguments. Like getDeepProperty(): And you’re facing a choice: should you pass the chain of fields directly: or as an array: Earlier, I preferred the former way because it seemed “cleaner”. Now, I use … Continue reading "Designing APIs: use arrays instead of rest parameters"

The post Designing APIs: use arrays instead of rest parameters appeared first on Ivan Akulov’s blog.