JavaScript concat string with backspace
问题 I have a function f similar to function f(str){ alert("abc"+str); } Now, I want to use JavaScript special charecter "\b" in such a way that I can choose if I want to display the hardcoded string "abc" or not. For example, f("\b\b"+"yz"); //should output "ayz" I tried the same, but it does not work. In other words, I want to concat a string with a backspace character so that I can remove last characters from the string. Can we do this in JavaScript? EDIT The real code is too much big (its a