JSFiddle - React, Tailwind, and code Playground

by jfriend00

JavaScript

var str = "This, is, another, word, followed, by, some, more";
var match = str.match(/,/g);
alert(match.length);