Some popular algorithms coded in JavaScript