Implementing forEach