From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/urlsearchparams/has/index.html | 66 +++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 files/ja/web/api/urlsearchparams/has/index.html (limited to 'files/ja/web/api/urlsearchparams/has') diff --git a/files/ja/web/api/urlsearchparams/has/index.html b/files/ja/web/api/urlsearchparams/has/index.html new file mode 100644 index 0000000000..1bb28c72e6 --- /dev/null +++ b/files/ja/web/api/urlsearchparams/has/index.html @@ -0,0 +1,66 @@ +--- +title: URLSearchParams.has() +slug: Web/API/URLSearchParams/has +tags: + - API + - Method + - URL API + - URLSearchParams + - has +translation_of: Web/API/URLSearchParams/has +--- +

{{ApiRef("URL API")}}

+ +

{{domxref("URLSearchParams")}} インターフェイスの has() メソッドは、指定された名前のパラメーターが存在するかどうかを示す {{jsxref("Boolean")}} を返します。

+ +

{{availableinworkers}}

+ +

構文

+ +
var hasName = URLSearchParams.has(name)
+ +

パラメーター

+ +
+
name
+
検索するパラメーターの名前。
+
+ +

戻り値

+ +

{{jsxref("Boolean")}}。

+ +

+ +
let url = new URL('https://example.com?foo=1&bar=2');
+let params = new URLSearchParams(url.search.slice(1));
+
+params.has('bar') === true; // true
+
+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('URL', '#dom-urlsearchparams-has', "has()")}}{{Spec2('URL')}}初期定義
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("api.URLSearchParams.has")}}

+
-- cgit v1.2.3-54-g00ecf