setting random values based on array
I'm trying to assign a random value from a predefined array. For example i have an array and i want to assign a random value from my array to the height of my selected boxes.
myArray = #(10, 20, 30, 40)
for i in selection do
i.height = random (myArray)
i know this doesn't work but it the best way to show what i am trying to achieve. I only want the new heights to be 10, 20, 30 or 40 as per array values.
Any help would be much appreciated.