A collection of articles by Jürg Lehni that—over time—shall touch upon the subjects of Programming, JavaScript, Geometry, Vector Graphics, as well as the programming libraries Paper.js and Straps.js.

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…