How can I randomize the requests in a scenario

I am not sure an extension is required in this case, unless we’re missing some fundamental functionality in k6 that prevents users from writing something like this in JavaScript? I gave an example of how a weightedSwitch() function can be implemented fairly simply in the thread @oleiade linked to, and that seems fairly similar to randomSwitch : How to distribute VU's across different scenarios with k6 - #17 by nedyalko

So this maybe something more appropriate for https://jslib.k6.io/, not an extension?