Node.js Client Chained Actions to Loop?

Hello guys, I was wondering if there’s anyone using node.js webdriver client.

I have a test that navigate through a list of tabs on the app, I was wondering how can I change it to a loop?

For example:

it('should navigate through all visible tabs', function(){
    return driver

The ids could come from an array (because it can change due to configurations) so I was wondering if it is possible to change it as loop so I don’t have to iterate them all.

Many thanks