P5.js code for creating a calculator tip app confused

the problem is that button.mousePressed(calculation); cannot see calculation because the former is inside setup and the later is in draw. You can either move calculation function outside draw, inside setup :slight_smile: