Could do `< 6 ? match[0].length : 6;` instead for one less unnecessary check. (But this isn't a huge deal by any means.)