Design Patterns · Junior · Question 61 of 75
Which name is best for a boolean variable?
- ✓Correct answer:
isModalOpen - 2
modal - 3
flag
Explanation
Prefixes like is, has, can, should make conditions read like sentences: if (isModalOpen).
Design Patterns · Junior · Question 61 of 75
isModalOpenmodalflagPrefixes like is, has, can, should make conditions read like sentences: if (isModalOpen).
Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.