How can I get the properties of a class using RTTi?

Unit: TypInfo

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