title: Comparing two words in javascript not working peoperly
body: <p>I want to compare two words, where for one word the letters are scrambled. It is working fine but If I add the same letters it returns true. I want the function to return false. Is there any generic method to do that. Please find my function below</p>
  <pre><code>const word1 = &quot;apple&quot;
  const compareLetters = getWord =&gt; {
      const word1Array = word1.split('');
      const getWordArray = getWord.split('');
      return word1Array.every(word =&gt; getWordArray.includes(word))
  }
  
  compareLetters('aplep'); // -&gt; this result gives true which is fine
  compareLetters('apled'); // -&gt; this gives false which is great
  compareLetters('aplepppppppppppppppp'); // -&gt; this give true as well. I wish to return this false
  </code></pre>