What happens when there are multiple occurrences of a value in a string when using it in replace()?

All occurrences of the value are replacedOnly the first occurrence of the value is replaced

All occurrences of the value are replaced.