review Javascript Algorithm : coderbyte and others