how to get the last character of a string var js code example Example: get last char javascript var lastChar = myString[myString.length -1];