word counting system v0.0.1

node v8.11.1
version: 1.0.0
endpointsharetweet
user = {}; wordsArr = ["hello","bye"];
function addWord(word,time) { if(!user[word]) user[word] = { count: 0, first: time }; user[word].count++; }
for(var i = 0; i < wordsArr.length; i++) { addWord(wordsArr[i],"1318"); } addWord("hello","1718"); addWord("henlo","1918");
console.log(user);
Loading…

no comments

    sign in to comment