Headers.values()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
Headers.values()
方法返回一个可迭代数值,通过这个数值可以遍历 Headers
中键值对的 value
值。返回的 value
都是 ByteString
对象。
备注: 这个方法可以在 Web Workers中使用。
语法
js
headers.values();
返回值
返回一个由键值对中 value
组成的数组。
例子
js
// Create a test Headers object
var myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.append("Vary", "Accept-Language");
// Display the values
for (var value of myHeaders.values()) {
console.log(value);
}
返回值为:
text/xml Accept-Language
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
values |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.