Skip to content

Commit 7717110

Browse files
authored
Create 2828-check-if-a-string-is-an-acronym-of-words.js
1 parent 15633d7 commit 7717110

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @param {string[]} words
3+
* @param {string} s
4+
* @return {boolean}
5+
*/
6+
const isAcronym = function(words, s) {
7+
let str = ''
8+
for(const e of words) str = str + e[0]
9+
return s === str
10+
};

0 commit comments

Comments
 (0)