We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Array#push()
1 parent f2cc36d commit d953407Copy full SHA for d953407
src/hackerrank/warmup/plusMinus.js
@@ -17,11 +17,11 @@ function plusMinus(arr) {
17
}
18
19
20
- const result = [];
21
-
22
- result.push((positives / arr.length).toFixed(6));
23
- result.push((negatives / arr.length).toFixed(6));
24
- result.push((zeros / arr.length).toFixed(6));
+ const result = [
+ (positives / arr.length).toFixed(6),
+ (negatives / arr.length).toFixed(6),
+ (zeros / arr.length).toFixed(6)
+ ];
25
26
return result.join(`\n`);
27
0 commit comments