I have a data which will show as the table and using orderBy(lodash) to sort data but it's not working as I want.
Now, I code as
const data = orderBy(realData, ['name'], ['asc'])
Here's my data
input:
[{name: 'A1'},{name:'A2'},{name: 'A21'},{name:'B10'},{name: 'A100'},{name:'A22'},{name: 'B32'},{name:'A3'}]
The issue is 'orderBy' sort data as it text(ASCII sorting)
current output:
[{name: 'A1'},{name: 'A100'},{name:'A2'},{name: 'A21'},{name:'A22'},{name:'A3'},{name:'B10'},{name: 'B32'}]
but I would like the data output like this
[{name: 'A1'},{name:'A2'},{name:'A3'},{name: 'A21'},{name:'A22'},{name: 'A100'},{name:'B10'},{name: 'B32'}]
If anyone have any suggestion, please help.
Thank you.