DEV Community

Discussion on: Interview Qs Decoded - # 1

Collapse
 
cubiclesocial profile image
cubiclesocial • Edited

The initializers should probably be undefined since the function will return the wrong result if the array consists of fewer than 2 items or if all items in the array consist of the same value.

Gotta watch out for those edge cases!