Skip to content

Commit d333648

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] SonarQube: Unnecessarily cloning an array.
Spread syntax should not be used unnecessarily javascript:S7747
1 parent dd77c4f commit d333648

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/sherlock_and_anagrams.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { logger as console } from '../../../logger.js';
77

88
function extraLongFactorials(n) {
9-
const rs = [...new Array(n)].reduce((a, b, i) => a * BigInt(i + 1), 1n);
9+
const rs = new Array(n).fill().reduce((a, b, i) => a * BigInt(i + 1), 1n);
1010
return rs;
1111
}
1212

0 commit comments

Comments
 (0)