Add a "forEach" method

Considering that "each" method will always execute the current loop and decide whether we continue or not,I've added a "preCondition" as a "if" statement to decide whether we continue/break/ignore the current loop