urlSearchParams[Symbol.iterator]()
-
返回:<Iterator>
¥Returns: <Iterator>
在查询字符串中的每个名称-值对上返回 ES6 Iterator。迭代器的每一项都是 JavaScript Array。Array 的第一项是 name,Array 的第二项是 value。
¥Returns an ES6 Iterator over each of the name-value pairs in the query string.
Each item of the iterator is a JavaScript Array. The first item of the Array
is the name, the second item of the Array is the value.
urlSearchParams.entries() 的别名。
¥Alias for urlSearchParams.entries().
const params = new URLSearchParams('foo=bar&xyz=baz');
for (const [name, value] of params) {
console.log(name, value);
}
// Prints:
// foo bar
// xyz baz