I need to replace hypen from string using Javascript but as per my code its not working.
function replace(){
var str='20-03-2019';
str.replace(/-/g,'/');
console.log(str);
}
replace();
Here I need to replace hypen(-
) with /
and output should like 20/03/2019
.