I want all strings to appear with a hyphen inside them:
var ejemplo = "forty-six";
They are cut from the hyphen, and ideally with a mutable method that forms a new variable with what has been cut after the hyphen. That is, it should work like this:
function cutString("forty-six") // Devuelve "six"
and leaves the example variable only with "forty":
ejemplo = "forty"
I have tried with the slice method but I don't see how to do it since there are several strings and their length changes.
The function you are looking for is split