Closed MichaelLiss closed 2 years ago
Why is page 1 based instead of 0 based?
When I send in:
{"page":0,"limit":3}
I get back:
{ "data": [ { "role": 21, "userType": 10, "lName": "BBBB" }, { "role": 21, "userType": 10, "lName": "KKKK" }, { "role": 21, "userType": 10, "lName": "LLLL" } ], "pageCount": 3, "totalCount": 7 }
{"page":1,"limit":3}
I am using Java (and most other languages for web programming) and data structures are 0 (zero) based, not 1 based.
get the first entry of array array[0].someField
array[0].someField
get the second array[1].someField
array[1].someField
See Array system cross-reference list here: https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(array)
https://en.wikipedia.org/wiki/Zero-based_numbering https://medium.com/analytics-vidhya/array-indexing-0-based-or-1-based-dd89d631d11c
@MichaelLiss Paging usually starts with 1. This has nothing to do with array index based numbering.
Why is page 1 based instead of 0 based?
When I send in:
I get back:
When I send in:
I get back:
I am using Java (and most other languages for web programming) and data structures are 0 (zero) based, not 1 based.
get the first entry of array
array[0].someField
get the second
array[1].someField
See Array system cross-reference list here: https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(array)
https://en.wikipedia.org/wiki/Zero-based_numbering https://medium.com/analytics-vidhya/array-indexing-0-based-or-1-based-dd89d631d11c