IDBKeyRange: includes() メソッド

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

メモ: この機能はウェブワーカー内で利用可能です。

includes()IDBKeyRange インターフェイスのメソッドで、指定のキーがこのキーの範囲に含まれるかを表す論理値を返します。

構文

js
includes(key)

引数

key

キーの範囲に含まれるかをチェックするキーです。任意の型を使用可能です。

返値

論理値です。

例外

DataError DOMException

指定されたキーが有効なキーでないとき投げられます。

js
const keyRangeValue = IDBKeyRange.bound("A", "K", false, false);

keyRangeValue.includes("F");
// true を返します

keyRangeValue.includes("W");
// false を返します

仕様書

Specification
Indexed Database API 3.0
# ref-for-dom-idbkeyrange-includes①

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
includes

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報