ZA2-Catalina-Alexandra Jora/ JavaScript-Core-1-Coursework-week1 - #290
ZA2-Catalina-Alexandra Jora/ JavaScript-Core-1-Coursework-week1#290AlexJora wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Hey, Catalina, well done on the exercises and mandatory. You did really well on the exercises, there's just a few things to note:
- For exercises/F exercise2: I think your name length will be two too long because you used the myName which had the spaces.
- For extra/2-piping: The functions were supposed to be general so: function add(num1, num2), instead of parameters you used numbers when declaring your function
- For mandatory/1: just before the "years" in string "years old" you need a space otherwise there would be no space between the age and that string
- For mandatory/3: your concatenation won't have any spaces in between the words and I'm not sure that the firstWord would be concatenated using this method
|
Well done Catalina, you seem to become a champion in creating variables, other instances were strings and had to remain that way but I see you put everything in variables, other than that well-done dear, |
|
|
||
| console.log(greeting); | ||
| let greeting = "Isn't good day at all!" | ||
| console.log(greeting); No newline at end of file |
There was a problem hiding this comment.
Hi Alex,
With this exercise I believe the aim was to print it 3 times. From this I understand you should have had 3 console.log greetings?
I hope the day went better after :)
| var message3 = " characters long"; | ||
|
|
||
| var nameLength = myName.length; | ||
| var message = message1 + trimmed + message2 + nameLength + message3; |
There was a problem hiding this comment.
I am just suggesting a shorter way, you could have written this, however all the variables may have made it clearer. for the trimmed one u could have put myName.trim straight into the message statement. Also u could maybe have just used variables for things that may change. But what u did is also not wrong. Here is just another alternative.
var message = "My name is" + myName.trim + " and my name is " + myName.length + "characters long";
| console.log(greeting(mentor3)); | ||
| console.log(greeting(mentor4)); | ||
| console.log(greeting(mentor5)); | ||
|
|
There was a problem hiding this comment.
Great simple way of doing this project.
Just suggesting alternatives, all the console.logs could have been done in the greeting as well but well done.
|
|
||
| function getStringLength(word) { | ||
| return "word".length(); | ||
| return word.length(); |
There was a problem hiding this comment.
Did you get this test to pass? As with word.length it is a property and therefore no () at the end - just word,length
chandredewet
left a comment
There was a problem hiding this comment.
Hi Catalina,
Great work as always. I have suggested some changes or alternatives. In some cases as noted, I have suggested alternatives, in other cases, am wondering if the test passed. Well done on doing the Extra exercises as well. I know your javascript will improve as a result.!
Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in
HOW_TO_MARK.mdin the root of this repositoryYour Details
Homework Details
Notes
What did you find easy?
What did you find hard?
What do you still not understand?
Any other notes?
View rendered exercises/B-hello-world/README.md
View rendered exercises/C-variables/README.md