Common algorithms implemented in javascript - Just for fun