js: phone-number: put double-one check in one place
js: word-count: replace for loop with Array#reduce