@chan4lk/sortatoz

Simple Sort function to sort arrays alphabetlically with a nested property

Usage no npm install needed!

<script type="module">
  import chan4lkSortatoz from 'https://cdn.skypack.dev/@chan4lk/sortatoz';
</script>

README

Simple Sort function to sort arrays alphabetically with a nested property

Usage

import {sortatoz} from '@chan4lk/sortatoz';

const array = [{name:'ranaweera'},{name:'chandima'}];

const sorted = array.sort(sortatoz('name'));

console.log(sorted); // {name:'chandima'}, {name:'ranaweera'}