Skip to content

Commit b4700ca

Browse files
committed
use .filter instead of (confusing) .reduce
1 parent 4c11c84 commit b4700ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/jasmine/tests/polar_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1143,9 +1143,9 @@ describe('Test polar interactions:', function() {
11431143
fig.layout.margin = {l: 50, t: 50, b: 50, r: 50};
11441144

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

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

0 commit comments

Comments
 (0)