How do you determine the mass and volume of a gas mass?
How else but by measurement?
And so you evacuate a container of KNOWN volume, record the so-called tare mass, i.e. the mass of the container, and then fill it with gas, and record the mass of the full container. And thus clearly you access the mass of the gas....and also its peculiar density...