Remove Last Character From String Javascript Program To Add