title: Filter a JavaScript array of strings matching a sequence of characters
body: <p>How can I efficiently filter an array of strings matching a sequence of characters, such that characters may be matched anywhere in the string but in the order they are used?</p>
  
  <p>It's a feature commonly seen in editors and IDEs to quickly filter filenames.</p>
  
  <p>See an illustration of the filter in action in the attached image link.</p>
  
  <p><img src="https://i.stack.imgur.com/es2xo.png" alt="Illustration of Filter in action"></p>
  
  <p>This is not a duplicate of <a href="https://stackoverflow.com/questions/11404855/javascript-autocomplete-without-external-library">JavaScript autocomplete without external library</a>, because one of the requirements here is for user input "Caz" to match "Cangzhou" which is explained in the answer to this question, but not in the answers to other questions.</p>