mavo icon indicating copy to clipboard operation
mavo copied to clipboard

`random(list)` should work

Open LeaVerou opened this issue 1 year ago • 1 comments

Currently to pick a random item from a list you need to either do first(shuffle(list)) (which is also wasteful) or get(list, random(0, count(list))) which is also very roundabout. random(list) should just work.

LeaVerou avatar Aug 13 '24 11:08 LeaVerou

would it make sense to have a second argument specifying the number of items you want returned? It would require returning an item if there is no argument and a list (even if it is a list of one item) if there is a second argument. Would this inconsistency be a bad choice?

karger avatar Jan 07 '25 05:01 karger