The fastest sorting algorithm ever with the speed of O(1)
npm install instant-sort
const { sort } = require('instant-sort')
function isSorted(arr) {
originalArr = arr.toString()
arr.sort(function(a,b){
return a - b;
})
return arr.toString() === originalArr;
}
const unsortedArray = [4, 1, 5, 2, 6, 9]
console.log(isSorted(unsortedArray)) // false
console.log(isSorted(sort(unsortedArray))) // true
Yes, this module is TypeScript-friendly! No need for DefinitelyTyped
const res = sort<Omit<IAnime, 'genres'>>([
{
name : {
romaji: 'Toaru Kagaku no Railgun T',
english: 'A Certain Scientific Railgun T',
native: 'とある科学の超電磁砲T',
},
},
{
name : {
romaji: 'Itai no wa Iya nanode Bougyo-Ryoku ni Kyokufuri Shitai to Omoimasu',
english: `BOFURI: I Don't Want to Get Hurt, so I'll Max Out My Defense.`,
native: '痛いのは嫌なので防御力に極振りしたいと思います。'
},
},
])
console.log(res) // Should return sorted array
We welcome all contributions by sending PR to this repository.
If you need help with anything, here're following methods:
If you have something you want to discuss in detail, or have hit an issue which you believe others will also have in deployment or development of the system, opening an issue is the best way to get help. It creates a permanent resource for others wishing to contribute to conversation.
If you like my project, please supporting me by buying some coffee