Why would a foam cup of hot cocoa stay hot

It won't stay hot forever but the reason it may not cool off as fast is that the foam cup is a better insulator than a glass cup.