The unit read-only property of the CSSUnitValue interface returns a string indicating the unit type.
unit
MDN Reference