Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 229 Bytes

File metadata and controls

13 lines (8 loc) · 229 Bytes

countWords()

Overview

Counts the number of words in a given string.

Code

A screenshot of the titular code snippet

const countWords = (string) => string.split(" ").length;