Skip to content

Files

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
65 lines (44 loc) · 1.4 KB

File metadata and controls

65 lines (44 loc) · 1.4 KB
title slug page-type tags browser-compat
FileSystemHandle.isSameEntry()
Web/API/FileSystemHandle/isSameEntry
web-api-instance-method
Directory
File
File System Access API
FileSystemHandle
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.

Syntax

isSameEntry(fileSystemHandle)

Parameters

  • {{domxref("FileSystemHandle")}}
    • : The FileSystemHandle to match against the handle on which the method is invoked.

Return value

Returns a {{jsxref('Boolean')}} which is true is the entries match.

Exceptions

No exceptions are thrown.

Examples

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

{{Specifications}}

Browser compatibility

{{Compat}}

See also