I'm new to Erlang so I am working on an example program and struggling to decide whether I should use an array or a list. Both are easy to create and handle but I didn't get:
- How you append an item to an array without knowing an index of where it should be appended. Is
array:set(array:size(A),"a",A)the way to go? - How to find out if a certain element is a member of the array, just as the
lists:member()function does. Do I have to iterate through the entire array and check each element for this?
And last, which one is better in terms of performance?