Design Patterns · Junior · Question 61 of 75

Which name is best for a boolean variable?

Explanation

Prefixes like is, has, can, should make conditions read like sentences: if (isModalOpen).

Further reading

Problem with a question

Design Patterns · Junior · question 61

Test yourself

Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz