A variant of 500 Rummy in JavaScript