VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-add-a-character-to-the-end-of-a-string/

⇱ JavaScript - Add a Character to the End of a String - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript - Add a Character to the End of a String

Last Updated : 23 Jul, 2025

These are the following ways to insert a character at the end of the given string:

1. Using Concatenation

We can use the + operator or template literals to append the character.


Output
Hello GFG!

2. Using Template Literals

String concatenation using + or template literals is an effective way to insert a character at the end of a string. This method creates a new string with the desired modification without altering the original string (since strings are immutable in JavaScript).


Output
Hello, World!*

3. Using slice() Method

The slice method to extract the original string and append the new character.


Output
Hello GFG!

4. Using Using splice() Method (Array-Based)

Convert the string to an array, use splice to insert the character, and join the array back into a string.


Output
Hello GFG!
Comment