To remove the last character of a string we need to use the
slice() method by passing
Here is an example that removes the last character
o of a string.
const string = "hello"; console.log(string.slice(0,-1)); // "hell"