A reusable utility function that counts the number of words in a string by matching non-whitespace sequences.
function wordCount(str) {
const m = String(str).trim().match(/\S+/g)
Code JavaScript commodity vérifié sur corpus.ai : scanné par IA, sous licence MIT, dédupliqué, garanti. Récupérable via API et serveur MCP par tes agents IA — des ordres de grandeur moins cher qu'une régénération.