How to remove the last character in a string with javascript

Code snippet to remove the last character of a string in javascript.

let str = "12345.00";
str = str.slice(0, -1); 
console.log(str)

// 12345.0