Javascript: How to Remove Characters From End of String? - Stack Overflow