Would it be faster to just put code inside a try-catch block instead of performing various error checks?
For example..
function getProjectTask(projec
Performance wise try-catch is 20-50% slower than if checks (https://jsperf.com/throw-catch-vs-if-check/1).
So, For rare usage, doesn't make much difference. For heavy usage, it might make some difference.
However, I feel it's bad practice to use try-catch, if it can be done by if checks except if it greatly reduces readability.