Conversation
rohni
left a comment
There was a problem hiding this comment.
Hey there,
A good effort, although I am missing:
- 2-step3.js
- 6-step3.js
- 7-step3.js
- step4.js
which is quite a lot of the homework.
I would look at the feedback as it seems you are missing some of the concepts these exercises are mean't to illustrate.
Best of luck with the rest of the course. 😄
| function foo(func) { | ||
| // What to do here? | ||
| return func | ||
| } |
There was a problem hiding this comment.
Not quite. All you will do here is return the function object. You want to call func and return the value from calling func.
....
return func();
....
| @@ -3,23 +3,38 @@ | |||
| // use a 'for' loop | |||
| function repeatStringNumTimesWithWhile(str, num) { | ||
| // add your code here | ||
| return str; | ||
| while (num > 0) { |
There was a problem hiding this comment.
You have to define string before you can use it.
This is where your program errors out because it cannot find string.
It is very obvious that you have not run or tested your program, otherwise you would have seen the error message, and been able to correct the problem which is:
let string = '';
| this.name = "Jumbo"; | ||
| this.color = "Black"; | ||
| this.numLegs = 4; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Correct. ✅
Just wondering why you removed the line that actually creates an instance of a Dog.
| this.color = "brown"; | ||
| this.numLegs = 4; | ||
| } | ||
| // Add your code below this line |
There was a problem hiding this comment.
This question was about nested loops, no the Dog.
| @@ -3,8 +3,14 @@ | |||
| const values = ['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']; | |||
There was a problem hiding this comment.
I seem to be missing, 6-step3.js, 7-step3.js, and step4.js.
| function removeDoubles(foo) { | ||
| const uniqueLetters = []; | ||
| for (let i = 0; i < foo.length; i++){ | ||
| uniqueLetters.push(foo[i]); |
There was a problem hiding this comment.
All you are doing here is copying the whole array. Not removing the duplicate values.
You need to check first whether the value already exists in uniqueLetters and if it does just skip to the next iteration of the loop, and if it does not, add it to uniqueLetters.
i did some steps, the other steps still working on it. sorry!!