Get last 10 characters from a string using Java script

If you want to get last 10 or 5 or nth characters from a string using java script, this can be done very easily.substr function can be use to this.
My string is “”
I want to get 2012/09.This can be get like this.

Further you want to remove these Forwardslashes(/) this can be done like this.

More info Java script remove backslashes and forwardslashes from a string