Permalink
Browse files

refactor ternary style

  • Loading branch information...
1 parent 91c5f97 commit 15a5597e2e8076566402df90f30b08716927a26b @tj committed Aug 21, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/reds.js
View
@@ -128,7 +128,9 @@ exports.stripStopWords = function(words){
exports.countWords = function(words){
var obj = {};
for (var i = 0, len = words.length; i < len; ++i) {
- obj[words[i]]? obj[words[i]] += 1: obj[words[i]] = 1;
+ obj[words[i]]
+ ? obj[words[i]] += 1
+ : obj[words[i]] = 1;
}
return obj;
};

0 comments on commit 15a5597

Please sign in to comment.