using JSHint to check for error in JavaScript