Get the last character of a string in JavaScript

Today, we will show you how to get the last character of a string in JavaScript. There are multiple methods to get the last character of a string.

Get the last character of a string in JavaScript

  1. Using charAt() method
  2. Using slice() method
  3. Using at() method
  4. Using split() & pop() method

1. Using charAt() method

2. Using slice() method

3. Using at() method

4. Using split() & pop() method

That’s it for today.
Thank you for reading. Happy Coding..!! 🙂

If you found value in this article,
you can support us by buying me a coffee! ☕

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *