JavaScript Function to convert strings from singular to plural