What are some potential dangers in using arrays in loops?