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