 <p>Your Processing code gets "sloppily" parsed and converted into JavaScript. Anything the parser doesn't understand just gets ignored, which means you can freely mix bits of JavaScript code in with your Processing and it will, in general, "just work".</p> <p>Have a look here for more information: <a href="http://processingjs.org/reference/articles/best-pratice" rel="nofollow noreferrer">http://processingjs.org/reference/articles/best-pratice</a></p>