Skip to content

Commit 694ea0a

Browse files
author
Gonzalo Diaz
committed
[BUGFIX] SonarQube: Prefer .at(…) over [….length - index].
Complex index access patterns should be replaced with ".at()" method javascript:S7755
1 parent e4096c4 commit 694ea0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/projecteuler/problem0007.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function problem0007(_top) {
2323

2424
console.log(`primes count: ${primes.length}`);
2525

26-
const answer = primes[primes.length - 1];
26+
const answer = primes.at(-1);
2727

2828
const cycles = i;
2929
console.log(`${_top} prime number is: ${answer} in ${cycles} cycles`);

0 commit comments

Comments
 (0)