79706271

Date: 2025-07-18 13:52:55
Score: 0.5
Natty:
Report link

You don't need a matched group. String's replace function will replace only the matched text and leave the remainder of the string unchanged.

let a = "aaa yyy bbb"

console.log(a.replace(/y+/, (match) => match.toUpperCase()))
// 'aaa YYY bbb'
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Riggy