last 10 index in a string javascript code example Example: javascript last character of string var lastChar = myString[myString.length -1];