Code to go logo
Created using Figma
Use Cases
Contribute
How to get last character of string in JavaScript
Strings
By Jad Joubran ·
Last updated Aug 18, 2022
const name = "Lewis"; name.at(-1);
s
Aug 18, 2022
1
Jad Joubran
See answer
1
Jad Joubran
String.at()
on Learn JavaScript Blog
Learn JavaScript step by step
Related use cases
How to get first character of string in JavaScript
How to get last array element in JavaScript