var a = {"one": 1, "two": 2, "three": 3, "four": 4} // The precise numeric values aren't defined since they are indexes into the // entry table and the hashing process isn't specified. So we just validate // what we can assume about them. var previous = -1 var iterator = a.iterate(null) while (iterator) { System.print(iterator > previous) System.print(iterator is Num) previous = iterator iterator = a.iterate(iterator) } // First entry: // expect: true // expect: true // Second entry: // expect: true // expect: true // Third entry: // expect: true // expect: true // Fourth entry: // expect: true // expect: true // Out of bounds. System.print(a.iterate(16)) // expect: false System.print(a.iterate(-1)) // expect: false // Nothing to iterate in an empty map. System.print({}.iterate(null)) // expect: false