[Solved] A closed range can never be empty, Why?


A Closed Range contains both its lower bound and its upper bound.

So even if you wrote:

let someRange = 0...0

It still contains one element: 0.

How would you attempt write an empty range? let someRange = ... ??
That doesn’t make much sense, and if you specify either the upper or lower bound, it is immediately non-empty.

2

solved A closed range can never be empty, Why?