Skip to content

Commit 90894c3

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] SonarQube: Do not call Array#push() multiple times.
Multiple consecutive calls to methods that accept multiple arguments should be combined javascript:S7778
1 parent a2341ae commit 90894c3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/hackerrank/implementation/countApplesAndOranges.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ function countApplesAndOranges(s, t, a, b, apples, oranges) {
1818
}
1919
}
2020

21-
const result = [];
22-
result.push(cApples);
23-
result.push(cOranges);
21+
const result = [cApples, cOranges];
2422

2523
return result.join('\n');
2624
}

0 commit comments

Comments
 (0)