Skip to main content

Define a Range

A range is all the numbers between two numbers. Let's see how you can work with ranges.

Create a range

You can declare a range by typing range(start .. end) like this:

If you prefer, you can also type a range as range(start through end), or range(start to end):

Contains

Much like dates, you can also as to whether a certain range contains a number:

Note that a range contains every number between two numbers, so this should be true:

Units in ranges

Much like a number, a range can have a unit:

Ranges of dates

You can have ranges of dates, like this: