---
title: "Discussion on \"How to find the last character of a string in JavaScript?\" | Hashnode"
description: "Discussion on \"How to find the last character of a string in JavaScript?\". In order to get the last letter of a string in JavaScript, you can subtract one from the string's length.\nvar firstName = \"julia\";\nvar lastLetter = firstname[firstName.length - 1]; // output: a"
url: "https://hashnode.com/posts/how-to-find-the-last-character-of-a-string-in-javascript/614caa46544e242e0c93f2f4"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to find the last character of a string in JavaScript?](https://abdullah-ahadi.hashnode.dev/how-to-find-the-last-character-of-a-string-in-javascript?utm_source=hashnode&utm_medium=feed)

In order to get the last letter of a string in JavaScript, you can subtract one from the string's length. var firstName = "julia"; var lastLetter = firstname\[firstName.length - 1\]; // output: a

Sep 23, 2021 · 1 min read · abdullah-ahadi.hashnode.dev  
Updated Oct 9, 2021  
Read the article

-   [#js](https://hashnode.com/tag/js)
-   [#string](https://hashnode.com/tag/string)

## Written by

[Abdullah Ahadi](https://hashnode.com/@Ahadi)

@Ahadi · Afghanistan

  
[View profile](https://hashnode.com/@Ahadi)

Software Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
