Return string without trailing slash javascript string trailing-slash I have two variables: I want to do something like this How do I do this? Answer Try this: