DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
reg ex with filter in js
function countSmileys(arr) { return arr.filter(x => /^[:;][-~]?[)D]$/.test(x)).length; }
Source by www.codewars.com #
PREVIOUS
NEXT
Tagged:
#reg
#filter
#js
ADD COMMENT
Topic
COMMENT
Name
2+9 =
Submit