Calling print(x) with an undefined variable brings up the browser print dialog. I noticed that there was a similar issue over on https://github.com/processing/p5.js-web-editor/issues/474 but that seemed to be more focused on calling print outside of setup or draw. In this case, it just happens if a variable becomes undefined.
One of my students stumbled across this by accidentally providing the dist function without enough parameters let x = dist(10, 35), which ended up returning undefined.
thanks for submitting this! i want to try this in a different code editor to make sure this is not an issue with p5.js but with the editor.
EDIT: this also happens in codepen (https://codepen.io/girlfriends/pen/GxwJZa) so maybe this is a p5.js issue?
EDIT2: i tried downloading the sketch and just serving the project using http-server. it still happens, so I'm fairly sure this is a p5.js issue.
posted in processing/p5.js#2765
Thanks! I should have checked there first >_<
no worries! it's not always easy to figure out an issue is with the editor or p5.js itself.
Most helpful comment
posted in processing/p5.js#2765