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.
1 parent 42534de commit 51070a9Copy full SHA for 51070a9
lesson_07/conditionals/src/lesson7.ts
@@ -116,9 +116,12 @@ export function addNumbers(values: number[]): number {
116
*/
117
export function getFirstNFibonacciNumbers(n: number): number[] {
118
119
- const array = [n]
120
- if (n == 0){
121
- return array;
+ const array = [1,1]
+
+ if (n <= 0){
122
+ return [];
123
+ }else if(n === 1){
124
+ return [1]
125
}
126
for(let i = 2; i < n; i++){
127
const cont = array[i - 1] + array[i - 2];
0 commit comments