onEvent("pb" + 1, "click", function() {
console.log(("pb" + 1) + " was clicked!");
});
onEvent("pb" + 2, "click", function() {
console.log(("pb" + 2) + " was clicked!");
});
onEvent("pb" + 3, "click", function() {
console.log(("pb" + 3) + " was clicked!");
});
onEvent("pb" + 4, "click", function() {
console.log(("pb" + 4) + " was clicked!");
});
I had to write 80 of these functions...
I'd like to make it so I could use a variable to include the range 1-80:
onEvent("pb" + [1, 80], "click", function() {
console.log(("pb" + [1, 80]) + " was clicked!");
});
I'm not sure if it's possible to define a variable as a set of individual numbers.