Skip to content

Commit

Permalink
use .filter instead of (confusing) .reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Aug 13, 2018
1 parent 4c11c84 commit b4700ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/jasmine/tests/polar_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1143,9 +1143,9 @@ describe('Test polar interactions:', function() {
fig.layout.margin = {l: 50, t: 50, b: 50, r: 50};

if(s.patch) s.patch(fig);
nTraces = fig.data.reduce(function(acc, trace) {
return (trace.type === 'scatterpolargl') ? ++acc : acc;
}, 0);
nTraces = fig.data
.filter(function(trace) { return trace.type === 'scatterpolargl'; })
.length;

Plotly.newPlot(gd, fig).then(function() {
scene = gd._fullLayout.polar._subplot._scene;
Expand Down

0 comments on commit b4700ca

Please sign in to comment.