Afaik, sand doesn’t absorb heat well, so when temperature is high, sand temperature is also high, but as soon as temperature drops (so, night) sand quickly releases all it’s heat, cooling itself rapidly. Since there’s no longer anything warm, the desert is cold.
On the other hand, water DOES absorb heat really well and unlike sand can release the heat it absorbed during the day much much slower, making lakes/beaches less cold during the night.
Maybe “absorb” isn’t the best term, but I can’t think of another one
Latest Answers