javascript string remove last character