FileSystemDirectoryHandle: entries() method
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The entries()
method of the
FileSystemDirectoryHandle
interface returns an array of a given object's
own enumerable property [key, value]
pairs, in the same order as that
provided by a for...in
loop (the difference being that a for-in loop
enumerates properties in the prototype chain as well).
Syntax
js
entries()
Parameters
None.
Return value
An array of the given FileSystemDirectoryHandle
object's own enumerable
property [key, value]
pairs.
Examples
js
const dirHandle = await window.showDirectoryPicker();
for await (const [key, value] of dirHandle.entries()) {
console.log({ key, value });
}
Specifications
Specification |
---|
File System Standard # api-filesystemdirectoryhandle-asynciterable |
Browser compatibility
BCD tables only load in the browser