Find Value Property
index of value v in els = index of value v in els with current index 0
This property says that finding a value in a list is equivalent to a finding operation with the current index of 0. This conversion allows us to initialize the index to 0. Then we can increment the index as we traverse the elements looking for our value.
Examples
index of value 4 in [ 2, [ 4, [ 8, [ ] ] ] ] = index of value 4 in [ 2, [ 4, [ 8, [ ] ] ] ] with current index 0
index of value "Orange" in [ "Apple", [ "Orange", [ "Tomato", [ ] ] ] ] = index of value "Orange" in [ "Apple", [ "Orange", [ "Tomato", [ ] ] ] ] with current index 0
index of value True in [ True, [ False, [ ] ] ] = index of value True in [ True, [ False, [ ] ] ] with current index 0
Comments
Please log in to add comments