19

hip hip [ ]

sorry, couldn't help myself.

Comments
  • 1
    Nope. My arrays start at 1
  • 23
    I count 4, with the last index being 3.
  • 0
    @620hun At first I thought this splitting hairs. And then I worked on code that used it interchangeably and we learned real fast that it REALLY matters
  • 4
    As @620hun said: the max index is 3. Therefore the number of elements is 4.

    In this case, everyone would count 4 apples.

    Why would one store those in an array if the purpose is to know the total number of apples anyway?
  • 1
    But, in the category of lame puns, it's a good one :)
  • 9
    No matter what if you get the length of the array the result will be 4.
  • 4
    Index is different than length m8
  • 0
    @FelisPhasma yes but it says "count by" not indexed by. The length is the count, how many elements in an array.. if you get the count aka the length, it will always be 4.
  • 0
    Also to clarify, in Lucee ArrayLen(local.arrayName) is how you get the count.
Add Comment