Chrome supports replaceAll so it is safe to use. However typescript still issues an error, so you may cast your string to any, in order to overcome that obstacle.
const date: any ="1399/06/08"
console.log(date.replaceAll('/','_'))
This automatically replaces all forward slashes with the underscore. Make sure to also keep the /g global indicator at the end of the regex, as it allows JS to know that you want to replace ALL places where the forward slash occurs.
The replaceAll method is defined inside lib.es2021.string.d.ts as follows:
interface String {
/**
* Replace all instances of a substring in a string, using a regular expression or search string.
* @param searchValue A string to search for.
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
replaceAll(searchValue: string | RegExp, replaceValue: string): string;
/**
* Replace all instances of a substring in a string, using a regular expression or search string.
* @param searchValue A string to search for.
* @param replacer A function that returns the replacement text.
*/
replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
}