London Class 7 - Negin Dn - Javascript - core1- coursework - Week1#59
London Class 7 - Negin Dn - Javascript - core1- coursework - Week1#59NeginDn wants to merge 3 commits into
Conversation
| } | ||
|
|
||
| function greetingMaker(mentorName) { | ||
| let greeting = "HELLO " + uppercaseName(mentorName); |
There was a problem hiding this comment.
I think, your function 'greetingMaker' can have two parameters, and the reason for that is what if we wanted to change the word 'HELLO' to something else later in future. And to do that you can write it like this :
function greetingMaker(capitalGreeting, name){
let greeting = capitalGreeting.toUpperCase() + " " + name
return greeting;
};
There was a problem hiding this comment.
You're absolutely right. I will change it.
Thank you for the feedback
| console.log(greeting); | ||
| //* Print your `greeting` to the console 3 times | ||
| let greeting = "Welcome to coding world"; | ||
| for (let i = 0; i < 3; i++) console.log(greeting); |
There was a problem hiding this comment.
At this stage there is no need to have a 'for' loop, it also won't answer the question as the code is not adding anything. To have three 'console.log()' , you just need write them like this:
console.log(greeting);
console.log(greeting);
console.log(greeting);
| // Start by creating a variable `message` | ||
| let myName = "Negin"; | ||
| let greeting = "Hello, My name is "; | ||
| let message = greeting + " " + myName; |
There was a problem hiding this comment.
In here, there is no need to have the " " to add extra space as you have already added it after the word is "
| @@ -1,3 +1,5 @@ | |||
| // Start by creating a variable `message` | |||
There was a problem hiding this comment.
Hi Negin, Well done!
Your code is correct, also there is another way you can try, it might be easier when using more than one variables.
let message= Hello my name is ${myName} and my name is ${lengthName} character long;
There was a problem hiding this comment.
Somayeh's suggestion is a good one to make your code more simple. The method is called string interpolation. https://www.freecodecamp.org/news/javascript-string-format-how-to-use-string-interpolation-in-js/
Be careful, when you use string interpolation in Javascript you have to wrap the string in backticks(`), not single quotes (').
| let greeting = createLongGreeting("Daniel", 30); | ||
| console.log(greeting); | ||
|
|
||
| greeting = createLongGreeting("Negin", 32); |
There was a problem hiding this comment.
Small thing.. the indenting on line 10 and 13 is off.
|
|
||
| function convertToBRL() {} | ||
| function convertToBRL(poundPrice) { | ||
| let realPrice = poundPrice * 5.7 * 0.99; |
There was a problem hiding this comment.
Could you indent the code in this function please?
|
Excellent job Negin! 🌟 |
|
Your coursework submission has been closed because nobody has interacted with it in 30 days. You are welcome to re-open it to get more feedback. |
Your Details
Homework Details