js remove the last character of a string

JavaScript
var str = 'mystring';

// the character 'g' will be removed
str = str.slice(0, -1);var str = "Your string"
str = str.slice(0, -1); 
console.log(str)
//returns "Your strin"str=str.slice(0, -1);let str = "12345.00";
str = str.substring(0, str.length - 1);
console.log(str);"somestring0".slice(0, -1)
// "somestring"ASDF
Source

Also in JavaScript: