Unscramble letters to form a word using Javascript