JSFiddle - React, Tailwind, and code Playground
JavaScript
var text = "Text — has — these — and – these – symbols".replace(/\u2013|\u2014/g, "-");
document.writeln(text);
var text = "Text — has — these — and – these – symbols".replace(/\u2013|\u2014/g, "-");
document.writeln(text);