How do I set an array of images and randomise results?

Hello Figma community!

I’m Wai Hong, just started out to learn Javascript. :blush: I’m trying to build a photo randomiser every time user click on a button. How do I set an array of image src urls and using onclick => to get a random result? I tried using Math.random but seems like it will not work in Figma.

Would love to know any way I could work around this? Thanks!