ConstSUBSCRIPT_GLYPHS["2"] // Returns "₂"
const formula = "H" + SUBSCRIPT_GLYPHS["2"] + "O" // Returns "H₂O"
export const SUBSCRIPT_GLYPHS: { [key: string]: string } = {
/* tslint:disable */
'0': '₀',
'1': '₁',
'2': '₂',
'3': '₃',
'4': '₄',
'5': '₅',
'6': '₆',
'7': '₇',
'8': '₈',
'9': '₉',
/* tslint:enable */
} as const;
A mapping of ASCII digits to their Unicode subscript glyphs, written as the literal characters (
₀–₉) rather than the\uXXXXescapes used by SUBSCRIPTS. The mapped values are identical toSUBSCRIPTSfor the digit keys — this is purely the literal-glyph spelling, handy where a source regex needs the visible characters.