string split last index javascript