A ranking prototype in javascript