const myText = "It is a long established fact that a reader will"
const newText = myText.split(" ").join("-")
console.log(newText);//It-is-a-long-established-fact-that-a-reader-will
const joinText = (string) => {
const newText = string.replace(/
/g, "");
};
console.log(joinText("Hello
World!"));
//Hello World!