collections/specialized/EvictingList.js
/**
		 * Copies the items in the list to a new array.
		 *
		 * @returns {Array}
		 */
Copies the items in the list to a new array.
@returns {Array}
Copies the items in the list to a new array . @returns { Array }
toArray() {
			let returnRef = [ ];
			if (!this.empty()) {
				let current = this._head;
				for (let i = 0; i < this._capacity; i++) {
					const item = this._array[current];
					if (item === empty) {
						break;
					}
					returnRef.push(item);
					current = getPreviousIndex(current, this._capacity);
				}
			}
			return returnRef;
		}
toArray ( ) { let returnRef = [ ] ; if ( ! this . empty ( ) ) { let current = this . _head ; for ( let i = 0 ; i < this . _capacity ; i ++ ) { const item = this . _array [ current ] ; if ( item === empty ) { break ; } returnRef . push ( item ) ; current = getPreviousIndex ( current , this . _capacity ) ; } } return returnRef ; }
Copies the items in the list to a new array.
Copies the items in the list to a new array .