For me personally "if (arr)" means "if I have a non-null array and there is something inside", so that something like while (arr) { remove_element(arr[0]); } would also work. Same way it works in Python, where: a = None if (a) // evaluates to false a = [] if (a) // evaluates to false a = [5] if (a) // evaluates to true