Skip to content

Commit

Permalink
refactor: remove unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Apr 29, 2020
1 parent afd1b11 commit 877aee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/word-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export function expandWordsToAcronym(words) {
const result = [];
// In American Broadcast Company -> ["C", "BC", "ABC", "IABC"]
const reversedWords = words.slice().reverse();
reversedWords.reduce((acronym, word, i) => {
reversedWords.reduce((acronym, word) => {
acronym.unshift(word.charAt(0));
result.push(acronym.join(""));
return acronym;
}, []);

// In American Broadcast Company -> ["I", "IA", "IAB", "IABC"]
words.reduce((acronym, word, i) => {
words.reduce((acronym, word) => {
acronym.push(word.charAt(0));
result.push(acronym.join(""));
return acronym;
Expand Down

0 comments on commit 877aee2

Please sign in to comment.