3
rated 0 times
[
10]
[
7]
/ answers: 1 / hits: 5570
/ 9 Years ago, mon, march 2, 2015, 12:00:00
Maybe I'm making a very stupid mistake but here it goes. I want to take [ 'hr' ]
and turn it into [ '* * *' ]
So I did this:
var hr = jsonml[i]
console.log(hr)
// outputs: [ 'hr' ]
hr.replace(/hr/g, '* * *')
But I get this error:
TypeError: Object hr has no method 'replace'
What am I doing wrong?
More From » arrays