Some classical algorithms made in Javascript