Find Value Match Property

if el = val, then index of value val in [ el, remain ] with current index idx = idx

If the first element in the list is equal to the value we are looking for, then we have found our element and the index is the current index.

Examples

if 8 = 8, then index of value 8 in [ 8, [ ] ] with current index 2 = 2

if 3 = 3, then index of value 3 in [ 3, [ 4, [ ] ] ] with current index 2 = 2

if "Durian" = "Durian", then index of value "Durian" in [ "Durian", [ ] ] with current index 3 = 3

Quiz (1 point)

If we are looking for 13, and the list is currently

[13, [15, []]]]

And the index is currently 4, then the index of value 13 in this list is

Become a subscriber to save your progress, see the correct answer, and more!

Comments

Please log in to add comments