UNPKG

hd-utils

Version:

A handy utils for modern JS developers

7 lines (6 loc) 276 B
import { StringOrNumber } from '../types'; /** * @description an implementation for bubbleSort algorithm, it will sort an array of numbers or strings. * @example bubbleSort([3,2,1]) // [1,2,3] */ export default function bubbleSort<T extends StringOrNumber>(arr: T[]): T[];