I may be overlooking something very obvious, but here is my dilemma. I am trying to convert [ 'hr' ]
into [ '* * *' ]
. This is what I tried:
var hr = jsonml[i]
console.log(hr)
// outputs: [ 'hr' ]
hr.replace(/hr/g, '* * *')
However, I am encountering this error:
TypeError: Object hr has no method 'replace'
Can someone point out what I am missing here?