How can I turn an array, such as ["Susy", "John", "Mary"] to "Susy, John, and Mary" in Javascript? I can’t get Ruby’s to_sentence method out of my head.
How can I turn an array, such as [Susy, John, Mary] to Susy, John,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Join all items except the last one, and then add that:
Demo: http://jsfiddle.net/JYKcK/1/