list.count
Conta os itens de uma lista.
Assinatura
list.count(ref: ElementRef, key: string): number
Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
ref | ElementRef | Obrigatório | O elemento em que atua, normalmente self. |
key | string | Obrigatório | O nome da lista. |
Retorna
number Quantos existem.
Exemplo
if (list.count(self, "pack") < 2) {
list.add(self, "pack", trinket, offer.where({ weight: { lte: 3 } }));
}
