Code now passes JSHints tests