P5.js code for creating a calculator tip app confused

so should i not make calculation() a function then and just put it in draw() instead?