Unit: TypInfo
pas2js supports regular RTTI not Delphi extended RTTI. The code is to be used as I provided it in my answer.