brianzelip/which-baltimore-neighborhood

Fix out of town error handling

Closed this issue · 1 comments

Being outside the city did not provide the alert set up for such a context.

main.js does not test for HOOD as an empty array correctly:

if (HOOD === []) {...}

This should do the trick:

if (!Array.isArray(array) || !array.length) {
  // array does not exist, is not an array, or is empty
}

Via https://stackoverflow.com/a/24403771/2145103

Done via 4d8fc91.