Sep 5, 2018 · 1 min read
I mention a function should have 1 statement, which should be return as being the ideal function. There are times when it becomes more clear to write on multiple lines or create names for additional values. So this is more of a rule of thumb and not a hard set rule.
While it can be done to always write every function as a 1 line expression. Sometimes it’s more clear to add values, like a const. and this is fine too.
Typically when there are multiple const's appearing, it is a sign that the function needs to be broken down further.
