1var str = 'mystring';
2
3// the character 'g' will be removed
4str = str.slice(0, -1);
1var str = "Your string"
2str = str.slice(0, -1);
3console.log(str)
4//returns "Your strin"
1var str = "Hello";
2var newString = str.substring(0, str.length - 1); //newString = Hell