URLSearchParams: entries() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
entries()
は URLSearchParams
インターフェイスのメソッドは、このオブジェクトに含まれるすべてのキー/値のペアを反復処理できるイテレーター
を返します。それぞれのペアのキーと値は文字列です。
メモ: この機能はウェブワーカー内で利用可能です。
構文
js
entries()
引数
なし。
返値
イテレーター
を返します。
例
js
// テスト用の URLSearchParams オブジェクトの作成
const searchParams = new URLSearchParams("key1=value1&key2=value2");
// キー/値のペアの表示
for (const [key, value] of searchParams.entries()) {
console.log(`${key}, ${value}`);
}
結果は次のとおりです。
key1, value1 key2, value2
仕様書
Specification |
---|
URL # dom-urlsearchparams-urlsearchparams |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
entries |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
URL
インターフェイス。