Skip to content

Instantly share code, notes, and snippets.

@leonardovff
Created March 8, 2023 04:00
Show Gist options
  • Save leonardovff/ea56d1fd71a6b1e5d810a6734025c407 to your computer and use it in GitHub Desktop.
Save leonardovff/ea56d1fd71a6b1e5d810a6734025c407 to your computer and use it in GitHub Desktop.
get unique words from long plan text
JSON.stringify(
Object.keys(X.replace(/\n/g, ' ')
.split(" ")
.filter(x => x != "")
.filter(x => !['1','2','3','4','5', '6','7','8','9','0'].includes(x)).filter(x => x.length != 1)
.reduce((acc, word) => ({...acc, [word]: true}), {}))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment