javascript-collections-framework
    Preparing search index...

    Function unmodifiableSortedSet

    • Returns a read-only view of a sorted set: as unmodifiableSet, with navigation (floor, ceiling, …), the comparator, and range and reversed views that are unmodifiable too.

      When set is already a view this function returns (printed as UnmodifiableSortedSet), it is returned unchanged. When it is any other unmodifiable view or immutable collection from this copy of the library, the new view reads that collection's source instead, and entries it hands out stay read-only, so read-only wrappers never nest.

      Time: O(1); each operation costs what the set's costs.

      Type Parameters

      • E

      Parameters

      Returns ReadonlySortedSet<E>

      set itself, or an unmodifiable view printed as UnmodifiableSortedSet.

      TypeError when set is not a sorted set from this library.

      unmodifiableSortedSet(new TreeSet([10, 20, 30])).floor(25) // 20