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