string ignore the last character javascript code example
Example 1: remove last character from string js
var str = "Your string"
str = str.slice(0, -1);
console.log(str)
//returns "Your strin"
Example 2: remove last 3 characters from string javascript
str = str.slice(0, -3);