score:3

Accepted answer
[
  "Some String",
  "Foo Bar"
]

score:1

const arr = ['some_string', 'foo_bar']
const result = arr.map(
  s => s
    .replace(/_/g, ' ')
    .replace(/^\w|\s\w/g, l => l.toUpperCase())
)

console.log(result)

Related Query

More Query from same tag