Function to sort the name in alphanumeric order

 lineItemDetails.sort((a, b) => {

          let itemNameA = a.item.text.toLowerCase();

          let itemNameB = b.item.text.toLowerCase();

          return itemNameA.localeCompare(itemNameB, undefined, { numeric: true, sensitivity: ‘base’ });

        });

Leave a comment

Your email address will not be published. Required fields are marked *