Why is the value of "f" not consistent?

In reply to dave_59:

Hi Dave,

Thank you for clarifying. When we compare index values where the index is a string, do we use alphabetical order or length of the string in determining which index value is greater or smaller than the other?

For example, in the associative array


array = '{"apple":0, "banana":5, "grapes":6};

Is index value “apple” greater than “grapes” or vice versa? If we use length of the string, “grapes” is greater, but if we go by alphabetical order, “apple” is greater.

Please let me know.

Thanks