lodash.head() vs [0] updated with optional chaining (version: 0)
Is head() needed only to check length !== 0 ?
P.s. Empty testcase for [0] is useless because it won't crash on trying to get nonexistent element
Comparing performance of:Not empty lodash.head() vs Not empty [0] vs Empty lodash.head() vs Empty [0] vs [0] with check vs [0] with null check vs [0] with optional chaining null check