Why replace
function doesn't replace all occurrences?
1) Ex that doesn't work:
//the funcion call
'999.999.999,00'.replace('.', '')
//This replaces only the first match, given as result as below
'999999.999,00'
2) Ex that works, but using regex:
//the funcion call
'999.999.999,00'.replace(/\./g, '')
//This replaces all matches, given as result as below
'999999999,00'
Is It right for Ex 1? Is It the correct behavior for replace
?