Skip to main content


Returns : String

Returns unit of a given string where the number comes first, then the unit.

Isolates the unit inside a string where the number is first, then the unit.

// returns the unit of a CSS valuegsap.utils.getUnit("50%"); // "%"gsap.utils.getUnit("100vw"); // "vw"


  1. value : String - The value that you want the unit of.