Switch comparaison
parent
8cd5c884e0
commit
d23e5ce91a
2
index.js
2
index.js
|
@ -13,8 +13,8 @@ const sortby = (properties) => (a, b) => {
|
|||
|
||||
const collator = new Intl.Collator('en', { numeric: true, sensitivity: 'base' })
|
||||
const compare = collator.compare(a[property], b[property])
|
||||
if (compare > 0) return -order
|
||||
if (compare < 0) return order
|
||||
if (compare > 0) return -order
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue