Last Occurrence of Character in String javascript code example
Example 1: javascript get last n characters of string
'abc'.slice(-1); // c
Example 2: find the last occurrence of a character in a string javascript
str.lastIndexOf(searchValue[, fromIndex])