var str = "Your string" str = str.slice(0, -1); console.log(str) //returns "Your strin"
str=str.slice(0, -1);
"somestring0".slice(0, -1) // "somestring"