math.choice js code example Example: js choice function >>> import random >>> random.choice(['red','green','blue']) 'green'