Does anyone know how I can match an array of jumbled letters to a word, for example, some function that will match an array e.g ["a","c","a","e","c"]; to a word "ace" and give me 1 or if not -1 like indexOf or InArray but for a jumbled word. I've made a js fiddle with an example it is well documented
just a note, I'll be comparing the array of letters to anywhere from 30000 - 50000 words.
https://jsfiddle.net/AlexanderMitrakis/89dchpt8/1/
this.gameletters = []; //Array of Game letters.
//e.g. ["P", "E", "H", "E", "U", "I", "S", "Q", "N"];
this.possiblesolution = new String(); //highest solution within gameletters
//e.g. "QUEENSHIP" (related to above letters)
this.wordBank = new Array();
//array of arrays structure is formated around alphabet with an array for each character:
/*
a: Array(7295)
b:Array(7271)
c:Array(11381)
d:Array(7216)
...
y:Array(607)
z:Array(623)
*/