Change for statement to forEach method.