downTo() Function
The downTo() function is used for creating a range in descending order i.e., from the given larger value to the smaller value. The downTo() function is the reverse of the (..) operator and rangeTo() function.
Here, we will demonstrate the example of creating an integer range using the downTo() function.
Example 1:
Output:
Example 2:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer