Get a score how scrambled a word is and test if it suffices your requirements
$ npm install scramblescore
$ bower install scramblescore
<script src="browser.js"></script>
scramblescore.score("ehllo", "hello")
// 1
scramblescore.test("AJvascript", "JAvascript", 1)
// true
Scramblescore.test("ehlol", "hello", 1)
// false
MIT