Ah, so does naming the variables at the beginning only load them once?
Any code outside functions is only executed once - when app starts.
Would I be better off naming '''var d = new Date();''' and such at the beginning, outside of my draw functions?
Usually it's better to keep variable inside function if that is possible, i.e. var d = new Date(); should be inside function.
var d = new Date();
But those images might be an exception if loading them from storage is too slow.
@malaire started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Any code outside functions is only executed once - when app starts.
Usually it's better to keep variable inside function if that is possible, i.e.
var d = new Date();
should be inside function.But those images might be an exception if loading them from storage is too slow.