FileSystemEntry: name property
The read-only name
property of
the FileSystemEntry
interface returns a string
specifying the entry's name; this is the entry within its parent directory (the last
component of the path as indicated by the fullPath
property).
Value
A string indicating the entry's name.
Examples
This example shows a function called isFileWithExtension()
which returns
true if the specified FileSystemEntry
is both a file and the file's name
ends with a given extension.
js
function isFileWithExtension(entry, extension) {
return entry.isFile && entry.name.endsWith(`.${extension}`);
}
Specifications
Specification |
---|
File and Directory Entries API # dom-filesystementry-name |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No 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.