Difference between revisions of "Bugs and mistakes"
From Wiki2
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==bugs and mistakes== | ==bugs and mistakes I always make== | ||
for sorting | |||
<pre> | |||
const conres = | |||
{ variety: 'Glacier', dot: 'yellow', num: 0 }, | |||
{ variety: 'Supersweet 100', dot: 'blue', num: 0 }, | |||
{ variety: 'Brandywine', dot: 'red', num: '5' }, | |||
{ variety: 'Purple Cherokee', dot: 'purple', num: '7' }, | |||
{ variety: 'Moskovich', dot: 'green', num: '4' }, | |||
{ variety: 'Valencia', dot: 'orange', num: '4' }, | |||
{ variety: 'Striped German', dot: 'pink', num: '4' }, | |||
{ variety: 'Glacier', dot: 'yellow', num: '4' }, | |||
{ variety: 'Supersweet 100', dot: 'blue', num: '4' }, | |||
const sorres =conres.sort((a,b)=>a.variety < b.variety ? -1 :1) | |||
NOT | |||
</pre> | |||
<s>const sorres =conres.sort((a,b)=>a.variety < b.variety)</s> |
Latest revision as of 13:59, 2 April 2019
bugs and mistakes I always make
for sorting
const conres = { variety: 'Glacier', dot: 'yellow', num: 0 }, { variety: 'Supersweet 100', dot: 'blue', num: 0 }, { variety: 'Brandywine', dot: 'red', num: '5' }, { variety: 'Purple Cherokee', dot: 'purple', num: '7' }, { variety: 'Moskovich', dot: 'green', num: '4' }, { variety: 'Valencia', dot: 'orange', num: '4' }, { variety: 'Striped German', dot: 'pink', num: '4' }, { variety: 'Glacier', dot: 'yellow', num: '4' }, { variety: 'Supersweet 100', dot: 'blue', num: '4' }, const sorres =conres.sort((a,b)=>a.variety < b.variety ? -1 :1) NOT
const sorres =conres.sort((a,b)=>a.variety < b.variety)