URLSearchParams
インターフェイスの entries()
メソッドは、このオブジェクトに含まれるすべてのキー/値のペアを反復処理できる iterator
を返します。 各ペアのキーと値は USVString
オブジェクトです。
註: この機能は Web Workers 内で利用可能です。
構文
searchParams.entries();
パラメーター
なし。
戻り値
iterator
を返します。
例
// テスト用の URLSearchParams オブジェクトの作成
var searchParams = new URLSearchParams("key1=value1&key2=value2");
// キー/値のペアの表示
for(var pair of searchParams.entries()) {
console.log(pair[0]+ ', '+ pair[1]);
}
結果は次のとおりです。
key1, value1 key2, value2
仕様
仕様 | 状態 | コメント |
---|---|---|
URL entries() (see "iterable") の定義 |
現行の標準 | 初期定義 |
ブラウザーの互換性
BCD tables only load in the browser
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
インターフェイス。