Implementing Operator Overloading in JavaScript
Paper.js comes with its own flavor of JavaScript called PaperScript. PaperScript does two things: It executes your code in its own scope, where all Paper.js classes appear to be global (without polluting the actual global scope), but more importantly it adds operator overloading to the JavaScript language. Operator overloading in PaperScript works by…