Exploring JavaScript's iterative methods