We have two equations that will allow us to calculate g of the moon without having to use the mass of an object.
Both of these equations have m, the mass of the object, but we can set them equal to each other and cancel m out.
Now we have an equation to find g which is the acceleration due to gravity.