Boris Zbarsky (2015-01-03T03:02:56.000Z)
On 1/2/15 9:40 PM, Axel Rauschmayer wrote:
> Can you give an example?

	get: function( num ) {
		return num != null ?

			// Return just the one element from the set
			( num < 0 ? this[ num + this.length ] : this[ num ] ) :

			// Return all the elements in a clean array
			slice.call( this );
	},

That's from jQuery 2.1.3.

And from the same place:

	function cache( key, value ) {
		// Use (key + " ") to avoid collision with native prototype properties 
(see Issue #157)
		if ( keys.push( key + " " ) > Expr.cacheLength ) {
			// Only keep the most recent entries
			delete cache[ keys.shift() ];
		}
		return (cache[ key + " " ] = value);
	}

That's after looking through about 1/10 of the library.  I'll bet there 
are more.  I'll also bet this sort of thing appears in every single 
major library out there.

-Boris
d at domenic.me (2015-01-12T17:52:55.660Z)
On 1/2/15 9:40 PM, Axel Rauschmayer wrote:
> Can you give an example?

```js
	get: function( num ) {
		return num != null ?

			// Return just the one element from the set
			( num < 0 ? this[ num + this.length ] : this[ num ] ) :

			// Return all the elements in a clean array
			slice.call( this );
	},
```

That's from jQuery 2.1.3.

And from the same place:

```js
	function cache( key, value ) {
		// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
		if ( keys.push( key + " " ) > Expr.cacheLength ) {
			// Only keep the most recent entries
			delete cache[ keys.shift() ];
		}
		return (cache[ key + " " ] = value);
	}
```

That's after looking through about 1/10 of the library.  I'll bet there 
are more.  I'll also bet this sort of thing appears in every single 
major library out there.