nodejs substring remove last character code example
Example 1: js remove last character from string
let str = "Hello Worlds";
str = str.slice(0, -1);
Example 2: remove last 3 characters from string javascript
str = str.slice(0, -3);
let str = "Hello Worlds";
str = str.slice(0, -1);
str = str.slice(0, -3);