A desert cools much more rapidly after sunset than a swampland. The reason lies in humidity and water vapor.
Desert air contains very little moisture. Without water vapor to trap outgoing longwave radiation, the heat absorbed by the ground during the day escapes quickly into space, causing sharp temperature drops.
Swamps have abundant surface water and high humidity. Water vapor acts like a blanket, absorbing and re-radiating heat back to the surface, slowing nighttime cooling.
This contrast explains why desert temperatures can swing 20–30°C (36–54°F) diurnally, while swamps remain relatively stable.