kbrsh / wade

:ocean: Blazing fast 1kb search library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using a Set instead of a Array for stopWords

SuperAmin opened this issue · comments

commented

I was wondering why stopWords is a Array of words instead of a Set (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) since it looks like you're only using it to check if a word in a document/query is contained in stopWords.

A set would be a better approach in this case, but they are not compatible with older versions of IE. Once most browsers support ES6 and Set, they will definitely be used in Wade.