Assuming that it is an array of strings, returns a proper serial-comma-separated description of the list including “and”, or “nothing” if the list is empty.
// Returns "a two-dollar pistol, a Stetson hat, and a shotgun": [ "a two-dollar pistol", "a Stetson hat", "a shotgun" ].commaList() // Returns "a two-dollar pistol and a Stetson hat": [ "a two-dollar pistol", "a Stetson hat" ].commaList() // Returns "a two-dollar pistol": [ "a two-dollar pistol" ].commaList() // Returns "nothing": [].commaList()
Assuming an array of PersistentObjects (or subclasses thereof), returns a serial-comma-separated description like .commaList(), but using those objects' .aName fields.
// Assuming pistol, hat, and shotgun are all valid PersistentObjects, // returns "a two-dollar pistol, a Stetson hat, and a shotgun": [ pistol, hat, shotgun ].aList()
Assuming an array of PersistentObjects (or subclasses thereof), returns a serial-comma-separated description like .commaList(), but using those objects' .theName fields.
// Assuming pistol, hat, and shotgun are all valid PersistentObjects, // returns "the two-dollar pistol, the Stetson hat, and the shotgun": [ pistol, hat, shotgun ].theList()