Which is best for mold? Air purifier vs dehumidifier

Why a dehumidifier is better against mold than an air purifier