Array buttons

I’ve been lookign around for this but cant seem to find how to do it. How do you make a array of buttons then call it in a event listner? The idea is that I don’t have to creat code for each button. it can just run it over for each button.