-
Notifications
You must be signed in to change notification settings - Fork 25
Chigazo Lesson 07 #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chigazo Lesson 07 #274
Conversation
…' into code on l.31 l.33; used 'for-of' loop instead of 'for' loop on l.104;
…oved 'return array' if 'n = 0'; corrected formatting on binarySearch ;
@@ -67,7 +115,14 @@ export function addNumbers(values: number[]): number { | |||
* @return An array containing the first `n` Fibonacci values. | |||
*/ | |||
export function getFirstNFibonacciNumbers(n: number): number[] { | |||
return []; | |||
|
|||
const array = [n] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't want to put n
here. If the function is called with 99
, then the array will be initialized to [99]
which is not what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to start the array as [1, 1] instead of [n]
|
||
const array = [n] | ||
|
||
for(let i = 2; i < n; i++){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you going to do if n === 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added else-if condition for n === 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added to return [1]
…atement for 'n==0';
No description provided.