Skip to content

Commit ba18e5d

Browse files
author
jjcapparell
committed
fixing fibonacci function pt 3
1 parent 048e7fa commit ba18e5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lesson_07/conditionals/src/lesson7.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ export function addNumbers(values: number[]): number {
152152
export function getFirstNFibonacciNumbers(n: number): number[] {
153153
const list: number[] = [];
154154
const indices = Array.from({ length: n - 1 }, (_, index) => index + 2);
155-
if (n>=1){
155+
if (n>=0){
156156
list.push(1);
157157
}
158-
if (n>=2){
158+
if (n>=1){
159159
list.push(1);
160160
}
161-
if (n>=3){
161+
if (n>=2){
162162
for (const i of indices) {
163163
list[i] = list[i - 1] + list[i - 2];
164164
}

0 commit comments

Comments
 (0)