how to get last character in textarea javascript code example Example: how to get last string in javascript 'abc'.slice(-2);