Ad
Code
Diff
  • const wordCount = x => x.trim().split(/[^\w-]+/).filter(s => s!== "").length
    • const wordCount = x => x.trim().split` `.length
    • const wordCount = x => x.trim().split(/[^\w-]+/).filter(s => s!== "").length