# Class FeatureList

A read-only view of a data/FeatureSet!FeatureSet that supports sorting and filtering. This is a "live" view that is updated as the underlying feature set changes.

#### Hierarchy (view full)

- ReadOnlyCollection<Feature>
  - FeatureList

#### Implements

- Entity
- Serializable<FeatureListProperties>

#####
Index

### Constructors

constructor

### Properties

_handles
@eventTypes
declaredClass
featureSet
id
title

### Accessors

_collection
destroyed
initialized
itemType
length

### Methods

_get
_getSerializableProperties
_onFeatureSetChange
_set
[iterator]
add
addHandles
addMany
applyFilter
assignProperties
assignPropertiesAsync
at
clone
concat
destroy
destroyAll
destroyMany
drain
every
filter
find
findIndex
finishAssignProperties
flatten
forEach
get
getDefault
getDefaults
getItemAt
getSerializableProperties
hasHandles
includes
indexOf
join
lastIndexOf
map
notifyChange
pop
push
reduce
reduceRight
remove
removeAll
removeAt
removeFilter
removeHandles
removeMany
reorder
reverse
set
shift
slice
some
sort
splice
toArray
toItemUri
toJSON
unshift
watch

##
Constructors

### constructor

- new FeatureList(featureSet): FeatureList

- #### Parameters

  - featureSet: FeatureSet

  #### Returns FeatureList

  Overrides ReadOnlyCollection.constructor

- new FeatureList(properties?): FeatureList

- #### Parameters

  - `Optional` properties: FeatureListProperties

  #### Returns FeatureList

  Overrides ReadOnlyCollection<Feature>.constructor

##
Properties

### `Protected` `Readonly`_handles

_handles: Handles<unknown, ResourceHandle>

Inherited from ReadOnlyCollection._handles

### @eventTypes

@eventTypes: CollectionEvents<Feature>

#### Deprecated

Do not directly reference this property. Use EventNames and EventTypes helpers from @arcgis/core/Evented.

Inherited from ReadOnlyCollection.@eventTypes

### declaredClass

declaredClass: string = "esri.core.Collection"

The declared class name. This is always `"esri.core.Collection"` for compatibility with Esri's API.

Inherited from ReadOnlyCollection.declaredClass

### `Readonly` featureSet

featureSet: FeatureSet

The backing set of features contained in this list.

### `Readonly` id

id: string

The unique ID for this entity.

Implementation of Entity.id

### title

title: string

A human-readable name for the feature list.

##
Accessors

### `Protected`_collection

- get _collection(): Collection<T>

- The underlying collection that this class delegates to.

  #### Returns Collection<T>

  Inherited from ReadOnlyCollection._collection

- set _collection(collection): void

- #### Parameters

  - collection: Collection<T>

  #### Returns void

  Inherited from ReadOnlyCollection._collection

### destroyed

- get destroyed(): boolean

- Whether the collection has been destroyed.

  #### Returns boolean

  Inherited from ReadOnlyCollection.destroyed

- set destroyed(value): void

- #### Parameters

  - value: boolean

  #### Returns void

  Inherited from ReadOnlyCollection.destroyed

### initialized

- get initialized(): boolean

- Whether the collection has been initialized.

  #### Returns boolean

  Inherited from ReadOnlyCollection.initialized

- set initialized(value): void

- Set to `true` once the initialize function has executed.

  #### Parameters

  - value: boolean

  #### Returns void

  Inherited from ReadOnlyCollection.initialized

### itemType

- get itemType(): string

- The item type for this entity when it participates in an App.

  #### Returns string

  Implementation of Entity.itemType

### length

- get length(): number

- The number of items in the collection.

  #### Returns number

  Inherited from ReadOnlyCollection.length

##
Methods

### `Protected`_get

- _get(propertyName): any

- #### Parameters

  - propertyName: string

  #### Returns any

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection._get

- _get<T>(propertyName): T

- #### Type Parameters

  - T

  #### Parameters

  - propertyName: string

  #### Returns T

  Inherited from ReadOnlyCollection._get

### `Protected`_getSerializableProperties

- _getSerializableProperties(): PropertyDefs<FeatureListProperties>

- #### Returns PropertyDefs<FeatureListProperties>

  #### Inherit Doc

### `Protected`_onFeatureSetChange

- _onFeatureSetChange(event): void

- Invoked whenever the underlying feature set has changed.

  #### Parameters

  - event: ChangeEvent<Feature, FeatureSet>

    The change event.

  #### Returns void

### `Protected`_set

- _set<T>(propertyName, value): this

- #### Type Parameters

  - T

  #### Parameters

  - propertyName: string
  - value: T

  #### Returns this

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection._set

### [iterator]

- [iterator](): IterableIterator<Feature, any, any>

- #### Returns IterableIterator<Feature, any, any>

  #### Inherit Doc

  Inherited from ReadOnlyCollection.[iterator]

### add

- add(_item, _index?): this

- Adds a single item to the collection.

  #### Parameters

  - _item: Feature
  - `Optional`_index: number

  #### Returns this

  Inherited from ReadOnlyCollection.add

### addHandles

- addHandles<T>(handles, groupKey?): void

- #### Type Parameters

  - T

  #### Parameters

  - handles: IHandle | IHandle[]
  - `Optional` groupKey: Exclude<T, ResourceHandle>

  #### Returns void

  #### Inherit Doc

  Inherited from ReadOnlyCollection.addHandles

### addMany

- addMany(items, index?): this

- Adds multiple items to the collection.

  #### Parameters

  - items: ReadonlyArrayOrCollection<Feature>

    An array or collection of items to add.

  - `Optional` index: number

    Zero-based index of where in the collection to add the items. If not specified, the items will be added at the end.

  #### Returns this

  Inherited from ReadOnlyCollection.addMany

### applyFilter

- applyFilter(criteria): void

- Filters the list in place to only include items that match the given criteria.

  #### Parameters

  - criteria:
    | string
    | FilterClause
    | FeaturePredicate
    | FilterClause[]

    The filter criteria to apply.

  #### Returns void

### assignProperties

- assignProperties(properties): void

- Sets the properties for this list.

  #### Parameters

  - properties: Partial<FeatureListProperties>

    An object containing property values to set.

  #### Returns void

  Implementation of Serializable.assignProperties

### assignPropertiesAsync

- assignPropertiesAsync(properties): Promise<void>

- Sets the properties for this item.

  This version will also await any asynchronous logic that is needed to set the properties.

  #### Parameters

  - properties: Partial<FeatureListProperties>

    A plain object containing property values to set, keyed by property name.

  #### Returns Promise<void>

  Implementation of Serializable.assignPropertiesAsync

### at

- at(index): Feature

- Returns the item at the specified index.

  #### Parameters

  - index: number

    Zero-based index of the item in the Collection to retrieve.

  #### Returns Feature

  The item in the Collection stored at the specified index.

  Inherited from ReadOnlyCollection.at

### clone

- clone(): Collection<Feature>

- Creates a deep clone of the Collection. To create a shallow clone of the collection, use slice().

  #### Returns Collection<Feature>

  Inherited from ReadOnlyCollection.clone

### concat

- concat(value): Collection<Feature>

- Creates a new Collection containing the items in the original Collection joined with the items in the input array or Collection.

  #### Parameters

  - value: Feature[] | Collection<Feature>

    The array or Collection to append to the existing Collection.

  #### Returns Collection<Feature>

  Inherited from ReadOnlyCollection.concat

### destroy

- destroy(): void

- Removes all event listeners and destroys the collection.

  #### Returns void

  Inherited from ReadOnlyCollection.destroy

### destroyAll

- destroyAll(): void

- #### Returns void

  #### Inherit Doc

  Inherited from ReadOnlyCollection.destroyAll

### destroyMany

- destroyMany(items): Feature[]

- #### Parameters

  - items: ReadonlyArrayOrCollection<Feature>

  #### Returns Feature[]

  #### Inherit Doc

  Inherited from ReadOnlyCollection.destroyMany

### drain

- drain(callback, thisArg?): void

- #### Parameters

  - callback: ItemCallback<Feature>
  - `Optional` thisArg: any

  #### Returns void

  #### Inherit Doc

  Inherited from ReadOnlyCollection.drain

### every

- every(callback): boolean

- Determines whether all items in the Collection pass a test defined by callback. Each item in the Collection is passed into the callback until one returns a value of false.

  #### Parameters

  - callback: ItemTestCallback<Feature>

    The function to call for each item in the Collection.

  #### Returns boolean

  Inherited from ReadOnlyCollection.every

### filter

- filter(callback): Collection<Feature>

- Filters the Collection's items based on a test defined by the callback function. Each item is passed into the callback function, which returns true if the item passes the test and false if it does not.

  #### Parameters

  - callback: ItemTestCallback<Feature>

    The function that defines a test for determining whether to return the item in a new Collection.

  #### Returns Collection<Feature>

  Inherited from ReadOnlyCollection.filter

### find

- find(callback): Feature

- Returns an item in the Collection if that item passes a test as defined in the callback function. Each item is passed into the callback function, which returns true if the item passes the test and false if it does not.

  #### Parameters

  - callback: ItemTestCallback<Feature>

    The testing function that will assess each item in the Collection. Returns true if an item passes the test and false if it fails.

  #### Returns Feature

  Inherited from ReadOnlyCollection.find

### findIndex

- findIndex(callback): number

- Returns the index of an item in the Collection if that item passes a test as defined in the callback function. Each item is passed into the callback function, which returns true if the item passes the test and false if it does not.

  #### Parameters

  - callback: ItemTestCallback<Feature>

    The testing function that will assess each item in the Collection. Returns true if an item passes the test and false if it fails.

  #### Returns number

  Returns the index of the Collection item that satisfies the test function. If an item fails the test, -1 is returned.

  Inherited from ReadOnlyCollection.findIndex

### finishAssignProperties

- finishAssignProperties(): Promise<void>

- Waits for all deserialization logic initiated thus far to finish, whether invoked by passing properties into the constructor, or by invoking `assignProperties()` or `assignPropertiesAsync()`.

  #### Returns Promise<void>

  Implementation of Serializable.finishAssignProperties

### flatten

- flatten(callback): Collection<Feature>

- Flattens a hierarchical Collection containing at least one child collection. Each item in the collection is passed into the callback function, which should check for child collections specified by the developer. A flat collection of all items (parent and children) is returned.

  #### Parameters

  - callback: ((item: Feature, index: number) => Feature[] | Collection<Feature>)

    A function that will assess each item in the Collection.

    - - (item, index): Feature[] | Collection<Feature>

      - #### Parameters

        - item: Feature
        - index: number

        #### Returns Feature[] | Collection<Feature>

  #### Returns Collection<Feature>

  Inherited from ReadOnlyCollection.flatten

### forEach

- forEach(callback): void

- Executes the input function for each item in the Collection.

  #### Parameters

  - callback: ItemCallback<Feature>

    The function to call for each item in the Collection.

  #### Returns void

  Inherited from ReadOnlyCollection.forEach

### get

- get<T>(propertyPath): T

- #### Type Parameters

  - T

  #### Parameters

  - propertyPath: string

  #### Returns T

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection.get

- get(propertyPath): unknown

- #### Parameters

  - propertyPath: string

  #### Returns unknown

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection.get

### getDefault

- getDefault<K>(key): FeatureListProperties[K]

- Gets the default value of an object's property.

  #### Type Parameters

  - K extends keyof FeatureListProperties

  #### Parameters

  - key: K

    The property of the object for which to get the default value.

  #### Returns FeatureListProperties[K]

  Implementation of Serializable.getDefault

### getDefaults

- getDefaults(): Partial<FeatureListProperties>

- Gets the object's default property values.

  #### Returns Partial<FeatureListProperties>

  Implementation of Serializable.getDefaults

### getItemAt

- getItemAt(index): Feature

- Returns the item at the specified index.

  #### Parameters

  - index: number

    Zero-based index of the item in the Collection to retrieve.

  #### Returns Feature

  The item in the Collection stored at the specified index.

  Inherited from ReadOnlyCollection.getItemAt

### getSerializableProperties

- getSerializableProperties(serializeMode?): PropertyDefs<FeatureSetProperties>

- Returns the serializable properties.

  #### Parameters

  - serializeMode: SerializeMode = "all"

    Optional. If specified, only properties that support the given serialization mode will be returned.

  #### Returns PropertyDefs<FeatureSetProperties>

  Implementation of Serializable.getSerializableProperties

### hasHandles

- hasHandles<T>(groupKey?): boolean

- #### Type Parameters

  - T

  #### Parameters

  - `Optional` groupKey: Exclude<T, ResourceHandle>

  #### Returns boolean

  #### Inherit Doc

  Inherited from ReadOnlyCollection.hasHandles

### includes

- includes(searchElement): boolean

- Tests if an item is present in the Collection.

  #### Parameters

  - searchElement: Feature

    The item to search for in the collection.

  #### Returns boolean

  Inherited from ReadOnlyCollection.includes

### indexOf

- indexOf(searchElement, fromIndex?): number

- Returns the index of an element in the collection.

  #### Parameters

  - searchElement: Feature

    Item to search for in the collection.

  - `Optional` fromIndex: number

    Use if you don't want to search the whole collection or you don't want to search from the start.

  #### Returns number

  Inherited from ReadOnlyCollection.indexOf

### join

- join(separator?): string

- Creates a string representation of the items in the Collection.

  #### Parameters

  - `Optional` separator: string

    The separator used between each item in the final string. The default is ",".

  #### Returns string

  Inherited from ReadOnlyCollection.join

### lastIndexOf

- lastIndexOf(searchElement, fromIndex?): number

- Returns the last index of an element in the collection.

  #### Parameters

  - searchElement: Feature

    Item to search for in the collection.

  - `Optional` fromIndex: number

    Use if you don't want to search the whole collection, or you don't want to search from the end.

  #### Returns number

  The location of the last match found in the collection, or -1 if there is no match.

  Inherited from ReadOnlyCollection.lastIndexOf

### map

- map<U>(callback): Collection<U>

- Passes each Collection item into the callback function and returns a new array of the returned values.

  #### Type Parameters

  - U

  #### Parameters

  - callback: ItemMapCallback<Feature, U>

    The function that processes each item in the Collection and returns a new value at the same index of the original item.

  #### Returns Collection<U>

  Inherited from ReadOnlyCollection.map

### `Protected` notifyChange

- notifyChange(propertyKey): void

- #### Parameters

  - propertyKey: string

  #### Returns void

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection.notifyChange

- notifyChange(propertyKey): void

- #### Parameters

  - propertyKey: keyof FeatureList

  #### Returns void

  Inherited from ReadOnlyCollection.notifyChange

### pop

- pop(): Feature

- Removes the last item from the collection and returns it.

  #### Returns Feature

  Inherited from ReadOnlyCollection.pop

### push

- push(item): number

- Adds an item to the end of the collection.

  #### Parameters

  - item: Feature

    The item to add.

  #### Returns number

  Inherited from ReadOnlyCollection.push

### reduce

- reduce<U>(callback, initialValue?): U

- Reduces all items in the collection (from left to right) into a single variable using callback.

  #### Type Parameters

  - U

  #### Parameters

  - callback: ItemReduceCallback<Feature, U>

    The function that processes each item in the Collection and appends it to the previous item.

  - `Optional` initialValue: U

    Item to use as the first element to process in callback.

  #### Returns U

  Inherited from ReadOnlyCollection.reduce

### reduceRight

- reduceRight<U>(callback, initialValue?): U

- Reduces all items in the collection (from right to left) into a single variable using callback.

  #### Type Parameters

  - U

  #### Parameters

  - callback: ItemReduceCallback<Feature, U>

    The function that processes each item in the Collection and appends it to the previous item.

  - `Optional` initialValue: U

    Item to use as the first element to process in callback.

  #### Returns U

  Inherited from ReadOnlyCollection.reduceRight

### remove

- remove(item): Feature

- Removes an item from the collection.

  #### Parameters

  - item: Feature

    The item to remove.

  #### Returns Feature

  Inherited from ReadOnlyCollection.remove

### removeAll

- removeAll(): Feature[]

- Removes all items from the collection.

  #### Returns Feature[]

  Inherited from ReadOnlyCollection.removeAll

### removeAt

- removeAt(_index): Feature

- Removes an item from the collection at a specified index.

  #### Parameters

  - _index: number

  #### Returns Feature

  Inherited from ReadOnlyCollection.removeAt

### removeFilter

- removeFilter(): void

- Removes any filter that was applied via applyFilter.

  #### Returns void

### removeHandles

- removeHandles<T>(groupKey?): void

- #### Type Parameters

  - T

  #### Parameters

  - `Optional` groupKey: Exclude<T, ResourceHandle>

  #### Returns void

  #### Inherit Doc

  Inherited from ReadOnlyCollection.removeHandles

### removeMany

- removeMany(items): Feature[]

- Removes each item in the input array. If an item is present multiple times in the collection, only the first occurrence is removed.

  #### Parameters

  - items: ReadonlyArrayOrCollection<Feature>

    The items to remove.

  #### Returns Feature[]

  Inherited from ReadOnlyCollection.removeMany

### reorder

- reorder(_item, _index): Feature

- Moves an item in the Collection to a specified index. The change event is fired after an item is moved in the Collection.

  #### Parameters

  - _item: Feature
  - _index: number

  #### Returns Feature

  Inherited from ReadOnlyCollection.reorder

### reverse

- reverse(): this

- Reverses the collection in place.

  #### Returns this

  Inherited from ReadOnlyCollection.reverse

### set

- set<T>(propertyPath, value): this

- #### Type Parameters

  - T

  #### Parameters

  - propertyPath: string
  - value: T

  #### Returns this

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection.set

- set(properties): this

- #### Parameters

  - properties: HashMap<unknown>

  #### Returns this

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection.set

### shift

- shift(): Feature

- Removes the first item from the collection (at index 0), and returns it. The remaining items of the collection are then shifted down one index from their previous location.

  #### Returns Feature

  Inherited from ReadOnlyCollection.shift

### slice

- slice(begin?, end?): Collection<Feature>

- Creates a new Collection comprised of a portion of the original Collection.

  #### Parameters

  - `Optional` begin: number

    The index of the first item to extract.

  - `Optional` end: number

    The index of the last item to extract.

  #### Returns Collection<Feature>

  Inherited from ReadOnlyCollection.slice

### some

- some(callback): boolean

- Determines whether an item in the Collection passes a test defined by callback. Each item in the Collection is passed into the callback until one returns a value of true.

  #### Parameters

  - callback: ItemTestCallback<Feature>

    The function that defines the test for each Collection item.

  #### Returns boolean

  Inherited from ReadOnlyCollection.some

### sort

- sort(criteria): this

- Sorts the Collection in place.

  #### Parameters

  - criteria:
    | string
    | SortClause
    | FeatureCompareFunction
    | (string | SortClause)[]

  #### Returns this

  Overrides ReadOnlyCollection.sort

### splice

- splice(_start, _deleteCount, ..._items): Feature[]

- Removes existing items and/or adds new items to the collection.

  #### Parameters

  - _start: number
  - _deleteCount: number
  - `Rest`..._items: Feature[]

  #### Returns Feature[]

  An array of the deleted items formerly part of the collection.

  Inherited from ReadOnlyCollection.splice

### toArray

- toArray(): Feature[]

- Returns a new array object containing the Collection's items.

  #### Returns Feature[]

  Inherited from ReadOnlyCollection.toArray

### toItemUri

- toItemUri(): string

- Creates an item:// URI reference to this entity.

  #### Returns string

  Implementation of Entity.toItemUri

### toJSON

- toJSON(serializeMode?): FeatureListProperties

- Returns a serializable representation of this list.

  #### Parameters

  - serializeMode: SerializeMode = "all"

    If specified, only properties that are appropriate for the given mode are returned. Otherwise, all properties will be serialized.

  #### Returns FeatureListProperties

  Implementation of Serializable.toJSON

### unshift

- unshift(item): number

- Adds an item to the beginning of the collection.

  #### Parameters

  - item: Feature

    The item to add.

  #### Returns number

  Inherited from ReadOnlyCollection.unshift

### watch

- watch(path, callback, sync?): IHandle

- #### Parameters

  - path: string | string[]
  - callback: ((newValue: any, oldValue: any, propertyName: string, target: any) => void)
    - - (newValue, oldValue, propertyName, target): void

      - #### Parameters

        - newValue: any
        - oldValue: any
        - propertyName: string
        - target: any

        #### Returns void

  - `Optional` sync: boolean

  #### Returns IHandle

  #### Deprecated

  - Unsupported on CollectionProxy.

  #### Inherit Doc

  Inherited from ReadOnlyCollection.watch