Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

London Class 7 - Negin Dn - Javascript - core1- coursework - Week1#59

Closed
NeginDn wants to merge 3 commits into
CodeYourFuture:masterfrom
NeginDn:master
Closed

London Class 7 - Negin Dn - Javascript - core1- coursework - Week1#59
NeginDn wants to merge 3 commits into
CodeYourFuture:masterfrom
NeginDn:master

Conversation

@NeginDn
Copy link
Copy Markdown

@NeginDn NeginDn commented Jan 22, 2021

Your Details

  • Your Name: Negin Dn
  • Your City: London
  • Your Slack Name: Negin Dn

Homework Details

  • Module: JS-1
  • Week: 1

Copy link
Copy Markdown

@Hozan94 Hozan94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @NeginDn , great work overall as you managed to successfully complete the exercises
. I added some comments to see which area you can improve on.

Copy link
Copy Markdown

@Hozan94 Hozan94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @NeginDn , great work overall as you managed to successfully complete the exercises
. I added some comments to see which area you can improve on.

}

function greetingMaker(mentorName) {
let greeting = "HELLO " + uppercaseName(mentorName);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing.. the indenting on line 10 and 13 is off.


function convertToBRL() {}
function convertToBRL(poundPrice) {
let realPrice = poundPrice * 5.7 * 0.99;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you indent the code in this function please?

@louisechow
Copy link
Copy Markdown

Excellent job Negin! 🌟

@github-actions
Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the Stale label May 13, 2021
@github-actions github-actions Bot closed this May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants