1var str = 'mystring';
2
3// the character 'g' will be removed
4str = str.slice(0, -1);
1var str = "Hello";
2var newString = str.substring(0, str.length - 1); //newString = Hell
1let str = "12345.00";
2str = str.substring(0, str.length - 1);
3console.log(str);
1const base = 'javascript, remove last char!'
2
3const s = base.slice(0, -1);
4
5console.log(s); // javascript, remove last char