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.

var firstName = "julia";
var lastLetter = firstname[firstName.length - 1]; // output: a