Demonstrate how to pick a random element from a list.




import extensions;
 
extension listOp
{
    randomItem()
        = self[randomGenerator.eval(self.Length)];
}
 
public program()
{
    var item := new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
 
    console.printLine("I picked element ",item.randomItem())
}