Moving for loop in serversniff to Array.forEach