メインコンテンツへスキップ
Docs
›
list.count

list.count

List

リスト内の項目を数えます。

シグネチャ

list.count(ref: ElementRef, key: string): number

パラメーター

名前型必須説明
refElementRef必須対象のエレメント。通常は self です。
keystring必須リストの名前。

戻り値

number 個数。

例

if (list.count(self, "pack") < 2) {
  list.add(self, "pack", trinket, offer.where({ weight: { lte: 3 } }));
}