sort-the-array
v1.0.7
Published
sorting the array
Downloads
5
Maintainers
Readme
Installation
npm install sort-the-array --save-devImport
Example: test.cjs file extensionconst { 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' ]