list.count
リスト内の項目を数えます。
シグネチャ
list.count(ref: ElementRef, key: string): number
パラメーター
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
ref | ElementRef | 必須 | 対象のエレメント。通常は self です。 |
key | string | 必須 | リストの名前。 |
戻り値
number 個数。
例
if (list.count(self, "pack") < 2) {
list.add(self, "pack", trinket, offer.where({ weight: { lte: 3 } }));
}
