Using JavaScript Logical and Comparison Operators: an Example