Skip to main content

Home > @jsplumb/util > suggest

suggest() function#

Add the given item to the given list if it does not exist on the list already.

Signature:

export declare function suggest(list: Array<any>, item: any, insertAtHead?: boolean): boolean;

Parameters#

ParameterTypeDescription
listArray<any>List to add to
itemanyItem to add
insertAtHeadbooleanIf true, insert new item at head. Defaults to false.

Returns:

boolean