In general, foreach is the one to use unless you are doing something that fits perfectly as a map or grep. map is for performing a simple transformation on a list that will return another list. grep is for selecting elements of a list that match a certain criteria (like grep'ing a file).
In reply to Re: grep, map vs. foreach performance
by perrin
in thread grep, map vs. foreach performance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |