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