1
0
Fork 0

Eliminate empty word at end of top words list.

feature/save-game
Daniel Perelman 5 years ago
parent e93c1ca0c3
commit c35ad4e130

@ -13,7 +13,7 @@ const dictionaryPromise = fetch('../wordlist/dictionaries/en_US/en_US.aff')
const topWordsPromise = fetch('../wordlist/en_50k.txt') const topWordsPromise = fetch('../wordlist/en_50k.txt')
.then(response => response.text()) .then(response => response.text())
.then(text => { .then(text => {
topWords = text.split('\n').map(line => { topWords = text.trim().split('\n').map(line => {
var arr = line.split(' '); var arr = line.split(' ');
return {'word': arr[0], 'frequency': Number(arr[1])}; return {'word': arr[0], 'frequency': Number(arr[1])};
}); });

Loading…
Cancel
Save