Added purposefully seg-faulting unit test that should catch the issue before erroring
Moved typeof array to Array.isArray