javascript split url last slash code example Example: split string form url last slash url = 'http://www.test.com/TEST1' l = url.split('/', -1)[-1]