javascript get last character of string