Last Occurrence of comma(,) in a string
Used this to dynamically create placeholder text when a user changed the coordinates format from default to custom. ex ['DD', 'DDM', 'DMS'] to remove the comma from the string. The format comes from an array of strings so I had to do a join(', ').replace(/\,(?=*$)/g, ' or') to get DD, DDM or DMS
Submitted by anonymous - 5 years ago