SyntaxFix
Write A Post
Hire A Developer
Questions
(('a a a').match(/b/g) || []).length; // 0 (('a a a').match(/a/g) || []).length; // 3
Based on https://stackoverflow.com/a/48195124/16777 but fixed to actually work in zero-results case.