You can use the substring function:

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

This is the accepted answer, but as per the conversations below, the slice syntax is much clearer:

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

Neither method mutates

Answer from Jon Erickson on Stack Overflow
🌐
Mastering JS
masteringjs.io › tutorials › fundamentals › remove-last-character
How to Remove the Last Character from a String in JavaScript - Mastering JS
To remove the last character from a string in JavaScript, you should use the slice() method. It takes two arguments: the start index and the end index.
🌐
Favtutor
favtutor.com › articles › remove-last-character-from-string-javascript
Remove the Last Character from a String in JavaScript
January 3, 2024 - By splitting the string into an array of characters, we can then remove the last character by using the pop() method to remove the last element.
🌐
Sentry
sentry.io › sentry answers › javascript › how do i remove/chop/slice/trim off the last character in a string using javascript?
How do I remove/chop/slice/trim off the last character in a string using Javascript? | Sentry
Strings in JavaScript are immutable, so whenever we want to manipulate one, we must create a new string with our desired changes. Therefore, to remove the last character of a string, we must create a new string that excludes it.
🌐
Byby
byby.dev › js-remove-last-char
How to remove last character from string in JavaScript
Here slice(0, -1) removes the last character because -1 means the last index of the string.
🌐
Coderslang
learn.coderslang.com › 0030-javascript-remove-last-character-from-a-string
JavaScript, remove last character from a string
February 14, 2021 - const base = 'javascript, remove last char!' const s = base.slice(0, -1); console.log(s); // javascript, remove last char · The function slice returns a part of the string. We pass in two values, start and end.
🌐
CoreUI
coreui.io › blog › how-to-remove-the-last-character-from-a-string-in-javascript
How to Remove the Last Character from a String in JavaScript · CoreUI
June 23, 2024 - Removing the last character from a string in JavaScript is a common task, whether you’re dealing with user input or formatting strings. JavaScript provides several methods to achieve this, including slice(), substring(), and replace(). This article will cover these methods in detail, ensuring ...
🌐
TecAdmin
tecadmin.net › remove-last-character-from-string-in-javascript
2 Methods to Remove Last Character from String in JavaScript – TecAdmin
April 26, 2025 - Use the slice() function to remove the last character from any string in JavaScript. This function extracts a part of any string and return as new string.
Find elsewhere
🌐
Medium
medium.com › @ryan_forrester_ › javascript-remove-last-character-from-string-fc1cabdf2722
Javascript Remove Last Character From String | by ryan | Medium
September 10, 2024 - However, for very large strings, slice() and substring() may be slightly faster. Compatibility: Ensure that the method you choose is compatible with the JavaScript version and environment you are working in. substr() is a legacy method and may not be supported in all environments. Suppose you are building a web application that processes user-entered phone numbers. You want to ensure that any trailing dashes are removed from the input.
🌐
Scaler
scaler.com › home › topics › remove last character from string in javascript
Remove the Last Character from a String in JavaScript - Scaler Topics
May 4, 2023 - In the code above, the substr method is used to remove the last character of the string by passing the starting index as 0 and ending index as "string.length - 1" Output: Use the replace() Method The replace() function in javascript can also ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-program-to-remove-first-and-last-characters-from-a-string
JavaScript- Remove Last Characters from JS String - GeeksforGeeks
July 23, 2025 - Convert the string into an array, remove the last element using the pop() method, and join the array back into a string.
🌐
Delft Stack
delftstack.com › home › howto › javascript › remove last character from javascript
How to Remove Last Character From String in JavaScript | Delft Stack
February 2, 2024 - We can also remove the last character from a string by using the replace() function. It takes a regular expression as an input and the replacement for the results of the regular expression.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-program-to-remove-last-character-from-the-string
JavaScript Program to Remove Last Character from the String - GeeksforGeeks
June 17, 2024 - In this approach, we will use substring() method for removing last character of string. The string.substring() is an inbuilt function in JavaScript that is used to return the part of the given string from the start index to the end index.
🌐
GoLinuxCloud
golinuxcloud.com › home › javascript › remove last character from string in js [5 methods]
Remove last character from string in JS [5 Methods] | GoLinuxCloud
November 11, 2023 - Using the split() and join() methods: You can split the string into an array of characters using the split() method, remove the last element of the array using pop(), and then join the remaining characters back into a string using the join() method.
🌐
Medium
medium.com › @onlinemsr › how-to-remove-the-last-character-from-a-string-in-javascript-3d1c238d1669
How to Remove the Last Character from a String in JavaScript | by Raja MSR | Medium
February 15, 2024 - Learn how to efficiently remove the last character from a string in JavaScript with this easy-to-follow beginner level tutorial!
🌐
DEV Community
dev.to › biplab3 › remove-last-character-from-javascript-string-1egd
Remove last character from javascript string - DEV Community
February 2, 2023 - So, you must know that the slice() function returns the extracted string except for the last character. That is why the slice() function helps us to remove the last character.
🌐
W3Schools
w3schools.com › jsref › jsref_pop.asp
JavaScript Array pop() Method
❮ Previous JavaScript Array Reference Next ❯ · Remove (pop) the last element: const fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.pop(); Try it Yourself » · pop() returns the element it removed: const fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.pop(); Try it Yourself » ·
🌐
DEV Community
dev.to › bybydev › how-to-remove-last-character-from-string-in-javascript-2ghf
How to remove last character from string in JavaScript - DEV Community
May 4, 2024 - The . within the regular expression represents any character, and the $ denotes the end of the string. So, .$ matches the last character in the string. By replacing it with an empty string, that character is removed.