Use forEach function instead of for statement.