79406885

Date: 2025-02-02 16:01:27
Score: 1
Natty:
Report link

using es6 you can do it in more simpler way

const str = '[Tom][]';
const count = str.match(/\[(.*?)\]/g)
    .map(x => x.slice(1, -1))
    .map(x => x.length)
    .join(', ');
console.log(count);

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Shahnewaz Tameem