FileSystemDirectoryHandle:values() 方法
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
FileSystemDirectoryHandle
接口的 values()
方法返回一个异步迭代器,用于迭代调用此方法的 FileSystemDirectoryHandle
中的条目的值。
语法
js
values()
参数
无。
返回值
一个新的包含 FileSystemDirectoryHandle
中每个条目的句柄的异步迭代器。
示例
使用 for await...of
循环能够简化迭代过程。
js
const dirHandle = await window.showDirectoryPicker();
for await (const value of dirHandle.values()) {
console.log(value);
}
规范
Specification |
---|
File System Standard # api-filesystemdirectoryhandle-asynciterable |
浏览器兼容性
BCD tables only load in the browser