You don't need to implement anything.
HeavyUser clearly thinks you're talking about how the TList enumerator works in actual FPC, not Pas2JS. "Pointer" is a valid keyword in Pas2JS but is used for essentially nothing because it's obviously meaningless in that context. More specifically, the TList in Pas2JS stores JSValues, not Pointers, as is the case for almost everything in Pas2JS.
Literally all you need to do to fix your example is change SomePerson to be a variable of type JSValue instead of type Pointer.
Also, on a broader note: TFPList, which is a drop-in replacement for TList in both real FPC and Pas2JS since it uses the same function names, is objectively a better way to go 100% of the time unless you specifically need the Notify capability of TList, as the fact that TFPList
doesn't have Notify and its associated checks makes it quite a bit faster.
In actual FPC though I'd highly recommend just using Generics.Collections or at the very least FGL, as then you can simply do stuff like:
type
TClassOneList = specialize TObjectList<TClassOne>;
TClassTwoList = specialize TObjectList<TClassTwo>;
TClassThreeList = specialize TObjectList<TClassThree>;
Which gives you three strongly-typed fully-implemented list classes instantly, with no ugly typecasting of void pointers required at any point.