This is a NURBS curve 2D demonstration on a webpage: https://peterpolgar.github.io/NURBS-curve-2D-demo
Programmed in an iterative way instead of recursion.
sketch.js contains explanatory comments to better understanding the code.
sketch_min.js is the hosted version which is the minified form of sketch.js.