I want to use replaceAll
in typescript and angular 10.
But I get this error: Property 'replaceAll' does not exist on type 'string'.
This is my code:
let date="1399/06/08"
console.log(date.replaceAll('/', '_'))
Output: 13990608
How can fix my typescript to show me this function?
You may solve the problem using RegExp and global flag
"1399/06/08".replace(/\//g, "_") // "1399_06_08"