Created
April 3, 2019 13:08
-
-
Save qqqrppp/4dbb9eeb979610c6a96a2c85c243387e to your computer and use it in GitHub Desktop.
parse text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const words = {} | |
const text = document.querySelector('body') | |
text.textContent | |
.trim() | |
.split(/\s/) | |
.filter(x => !~x.search(/[\d\W\s]/)) | |
.forEach(word => words[word] = word) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment