how to remove lasr char from string in javascript

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

Also in JavaScript: