Untitled
unknown
javascript
3 years ago
299 B
7
Indexable
// Example values, in an array
const values = ['OS','XXS','XS','XS/S','S','S/M','M','M/L','L','L/XL','XL','XL/XXL','XXL','XXXL'];
export const sizeSortBy = (a, b) => {
let value = '';
if (values) {
value =
values.indexOf(a.name) -
values.indexOf(b.name);
}
return value;
};Editor is loading...