Replace for with forEach