function formatString(str) {
const formatted = str.split(',')
.map(subStr => `${subStr}(${subStr.length})`)
.join(', ');
return formatted;
}
The expected output was "hello(5), world(5), abra(4), carabfa(7), re(2), wrewer(6), rwer(4)".
What are some drawbacks of using '(' + x.length + ')'
in this code snippet?