That plateau after the peak is not a plateau-peak, it's just a plateau.
At index 20 there is a plateau-peak.
for arr [1,2,5,4,3,2,3,6,4,1,2,3,3,4,5,3,2,1,2,3,5,5,4,3], expected { pos: [ 2, 7, 14 ], peaks: [ 5, 6, 5 ] } to deeply equal { pos: [ 2, 7, 14, 20 ], peaks: [ 5, 6, 5, 5 ] }. How ?
expected { pos: [ 2, 3 ], peaks: [ 3, 2 ] } to deeply equal { pos: [ 2 ], peaks: [ 3 ] } assert.deepEqual(pickPeaks([2,1,3,2,2,2,2,5,6]), {pos:[2], peaks:[3]});
why?
Loading collection data...
That plateau after the peak is not a plateau-peak, it's just a plateau.
At index 20 there is a plateau-peak.
for arr [1,2,5,4,3,2,3,6,4,1,2,3,3,4,5,3,2,1,2,3,5,5,4,3],
expected { pos: [ 2, 7, 14 ], peaks: [ 5, 6, 5 ] } to deeply equal { pos: [ 2, 7, 14, 20 ], peaks: [ 5, 6, 5, 5 ] }. How ?
expected { pos: [ 2, 3 ], peaks: [ 3, 2 ] } to deeply equal { pos: [ 2 ], peaks: [ 3 ] }
assert.deepEqual(pickPeaks([2,1,3,2,2,2,2,5,6]), {pos:[2], peaks:[3]});
why?