Finish translating algorithms to JavaScript

...else I fear they shall never get done
and that, my dear, wouldn't be much fun.
For what fun is it when it's all due
and you're still coding without a clue?