Others
Primitives
classNames
Merge classname(s).
clamp
Clamp a number between a minimum and maximum value.
exponential
Convert a number to exponential notation.
Array
sortMixedArrAsc
Mixed types array ascending sorting.
- This function supports all Primitive types, it aims to handle MIXED types of array elements sorting.
- Single type array sorting works fine too (eg:
number[]
,string[]
, etc..). But we should just write aarray.sort
instead. symbol
is not supported.- Sort descending? Use
sortMixedArrAsc(...).reverse()
.
Type definition
Parameter | Type | Default | Description |
---|---|---|---|
inputArr | SortableMixedArr | Required | a mixed typed array. |
mutate | boolean | false | Should the origin array be mutated? |