Strange attractors in JavaScript