Completion, blackjack to js conversion