/**
* Generates a list of Sones by concatening the names of the given sones with a
- * new line character (ā\nā).
+ * comma.
*
* @param sones
* The sones to format
* @returns {String} The created string
*/
function generateSoneList(sones) {
- var soneList = "";
- $.each(sones, function() {
- if (soneList != "") {
- soneList += ", ";
- }
- soneList += this.name;
- });
- return soneList;
+ return sones.reduce((soneList, sone) => soneList + ", " + sone.name, "").substring(2)
}
/**