implementing sorting algorithms in javascript just for fun.