jsarray

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package jsarray implements JavaScript Array semantics that ported code observes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort[T any](items []T, compare func(a, b T) float64)

Sort sorts items in place exactly as V8's Array.prototype.sort does with a comparator (V8 third_party/v8/builtins/array-sort.tq, TimSort). The comparator returns a JavaScript number: negative, zero, positive or NaN (treated as zero). A comparator that is not a consistent strict weak order, such as highlight.js highlightAuto's supersetOf tie-break, produces V8's order, because the result depends on the comparisons TimSort makes and not only on stability.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL