//more compact way: "my example text".split("").reverse().join("");
const reverse = (string) => { const newText = string .split("") .reverse() .join(""); return newText }; console.log(reverse("Hello world")) //dlrow olleH