  In this paper, we investigate the thermodynamics especially the Joule-Thomson
expansion of the $n$-dimensional FRW (Friedmann-Robertson-Walker) universe with
a perfect fluid. We derive the thermodynamic equations of state $P=P(V, T)$ for
the $n$-dimensional FRW universe in Einstein gravity and Einstein-Gauss-Bonnet
gravity, where the thermodynamic pressure $P$ defined by the work density $W$
of the perfect fluid, $i.e.$ $P\equiv W$. Furthermore, we present the
Joule-Thomson expansion as an application of these equations of state to
elucidate the cooling-heating properties of the $n$-dimensional FRW universe.
We determine the inversion temperature and inversion pressure in the FRW
universe with arbitrary dimensions for the first time, and illustrate the
characteristics of inversion curves and isenthalpic curves in the $T$-$P$
plane. This study offers insights into deepening our comprehension of cooling
and heating regions in the FRW universe, thereby revealing its expansion
mechanisms.
