166k views
4 votes
What is the difference between myList.length and myList.length - 1? When would you use myList.length? When would you use myList.length - 1?

User Ethan SK
by
5.6k points

1 Answer

4 votes

Answer:

The difference between myList.Length and myList.length - 1 is that with the second variable, you are subtracting 1 from the total (assuming it is a integer)

Step-by-step explanation:

Assuming the variable myList.Length is a integer, like for example, 4, it would be equal to 4, while myList.Length - 1 would be 3.

User Theastronomist
by
5.4k points