Comment on page
The Unitroller contract has an array called allMarkets that contains the addresses of each fToken contract. Each address in the allMarkets array can be used to fetch a metadata struct in the Unitroller’s markets constant.
fToken public allMarkets;
Unitroller troll = Unitroller(0xABCD...);
fToken fTokens = troll.allMarkets();
const unitroller = new web3.eth.Contract(unitrollerAbi, unitrollerAddress);
const fTokens = await unitroller.methods.allMarkets().call();
const fToken = fTokens; // address of a fToken