title | slug | page-type | tags | browser-compat | |||||
---|---|---|---|---|---|---|---|---|---|
FileSystemHandle.isSameEntry() |
Web/API/FileSystemHandle/isSameEntry |
web-api-instance-method |
|
api.FileSystemHandle.isSameEntry |
{{securecontext_header}}{{APIRef("File System Access API")}}
The isSameEntry()
method of the
{{domxref("FileSystemHandle")}} interface compares two {{domxref("FileSystemHandle",
"handles")}} to see if the associated entries (either a file or directory) match.
isSameEntry(fileSystemHandle)
- {{domxref("FileSystemHandle")}}
- : The
FileSystemHandle
to match against the handle on which the method is invoked.
- : The
Returns a {{jsxref('Boolean')}} which is true
is the entries match.
No exceptions are thrown.
The following function compares a single entry with an array of entries, and returns a new array with any matching entries removed.
function removeMatches(fileEntry, entriesArr) {
let newArr = entriesArr.filter((entry) => !fileEntry.isSameEntry(entry))
return newArr;
}
{{Specifications}}
{{Compat}}