More efficient .
Since it lengthis an operation linearfor some collections, such as List, for execution, x.length == 3you must first calculate the length, and then compare it with the value. On the other hand, it .lengthComparewill complete the length calculation if it turns out that the comparison is no longer so.
source
share