There is absence of atmosphere on the moon,so no part of heat remains trapped in its atmosphere. That is why in day time moon gets hot and in night it cools down and cools fast and all heat is radiated off into the space there by making variation of moon’s surface temperature extreme.