Echo Hollow

Gender-Bending Interactive Stories! :D

User Tools

Site Tools


smutbook:classes:util:array_prototypes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
smutbook:classes:util:array_prototypes [2026/08/25 12:13] leesmutbook:classes:util:array_prototypes [2026/08/25 13:58] (current) – removed lee
Line 1: Line 1:
-====== Array Prototypes ====== 
- 
-===== Array.prototype.commaList() ===== 
- 
-Assuming that it is an array of PersistentObjects or strings, returns a proper serial-comma-separated description of the list including "and", or "nothing" if the list is empty. 
- 
-<code> 
-// 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() 
-</code> 
- 
-===== Array.prototype.CommaList() ===== 
- 
-As above, but with the first letter capitalized. 
- 
-===== Array.prototype.aList =====  
- 
-Assuming an array of PersistentObjects (or subclasses thereof), returns a serial-comma-separated description like .commaList(), but using those objects' .aName fields. 
-<code> 
-// Assuming pistol, hat, and shotgun are all valid PersistentObjects, 
-//  returns "a two-dollar pistol, a Stetson hat, and a shotgun": 
-[ pistol, hat, shotgun ].aList()  
-</code> 
- 
-===== Array.prototype.theList =====  
- 
-Assuming an array of PersistentObjects (or subclasses thereof), returns a serial-comma-separated description like .commaList(), but using those objects' .theName fields. 
-<code> 
-// Assuming pistol, hat, and shotgun are all valid PersistentObjects, 
-//  returns "the two-dollar pistol, the Stetson hat, and the shotgun": 
-[ pistol, hat, shotgun ].theList()  
-</code> 
- 
  
smutbook/classes/util/array_prototypes.1787685192.txt.gz · Last modified: by lee