sort-the-array

1.0.7 • Public • Published

Installation

npm install sort-the-array --save-dev

Import

Example: test.cjs file extension
const { sortNumbers, sortStrings } = require('sort-the-array');

Usage

const numbers = [4, 2, 7, 1, 5];
const strings = ['banana', 'apple', 'orange', 'grape'];

console.log('Sorted numbers:', sortNumbers(numbers)); // Sorted numbers: [ 1, 2, 4, 5, 7 ]
console.log('Sorted strings:', sortStrings(strings)); // Sorted strings: [ 'apple', 'banana', 'grape', 'orange' ]

Package Sidebar

Install

npm i sort-the-array

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

2.5 kB

Total Files

4

Last publish

Collaborators

  • gurivisetti-gopikrishna