NW5-Manchester-Sandra Duarte-JavaScript-core-1-Week3 - #131
Conversation
Ara225
left a comment
There was a problem hiding this comment.
Good work I've called out a few errors, but left you to figure out exactly what they are so it sticks, let me know if you struggle with that I see you've missed the 4th one, it's pretty hard but I'm sure you know enough to make a good start if you do it
|
|
||
|
|
||
| // Example 4 | ||
| // This array has 3 elemente 0,1,2. |
| } | ||
|
|
||
| sayHelloToUser(); | ||
| // the argument doesn't pass |
| console.log(a); | ||
|
|
||
| console.log(a); | ||
| // we can print the value because (a)was not declared. let a = 2; |
There was a problem hiding this comment.
Techincally, it's been declared but not dinfied, but I get what you mean and it's right
| // we can print the value because (a)was not declared. let a = 2; | ||
|
|
||
| // Example 2 | ||
| function sayHello() { |
There was a problem hiding this comment.
Why does this function return undefined?
| let string = ""; | ||
| let count = 0; | ||
| while(count < n) { | ||
| string += `${even[count]},`; |
There was a problem hiding this comment.
All looking good, love how you used ` They're so good :)
| function getRandomNumberGreaterThan50() { | ||
| // TODO - implement using a do-while loop | ||
| let number = 0; | ||
| do{ |
| @@ -15,6 +15,13 @@ function getTemperatureReport(cities) { | |||
| // TODO | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
This file throws an exception when run, specfically a "ReferenceError: cities is not defined" Can you see why?
| total += article.length; | ||
| } | ||
|
|
||
| return Math.round(total / allArticleTitles.length); |
There was a problem hiding this comment.
This line cause a problem. Can you see why?
| function headlinesWithNumbers(allArticleTitles) { | ||
| // TODO | ||
| return allArticleTitles.filter((article) => { | ||
| return /\d/.test(article); |
There was a problem hiding this comment.
Good work, I'm not sure if you've been taught regular expressions yet but they're very useful beasts indeed
| function headlinesWithNumbers(allArticleTitles) { | ||
| // TODO | ||
| return allArticleTitles.filter((article) => { | ||
| return /\d/.test(article); |
There was a problem hiding this comment.
Good work, I'm not sure if you've been taught regular expressions yet but they're very useful beasts indeed
No description provided.