1var str = 'mystring';
2
3// the character 'g' will be removed
4str = str.slice(0, -1);
1str = "hello I'm McDown...";
2newStr = str.substring(0, str.length - 3); // Returns "hello I'm McDown"
1const base = 'javascript, remove last char!'
2
3const s = base.slice(0, -1);
4
5console.log(s); // javascript, remove last char