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