Check If String Ends With Character Javascript