Using an array type in boolean contexts is bug-prone. Please just write « arr.length » of anything you want. If you want to see a reasons to forbid it - look at original bug report.