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