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

NW5_Leeds_Shimaadnan_JavaScript_ First Week - #394

Open
Shimaadnan wants to merge 7 commits into
CodeYourFuture:masterfrom
Shimaadnan:master
Open

NW5_Leeds_Shimaadnan_JavaScript_ First Week#394
Shimaadnan wants to merge 7 commits into
CodeYourFuture:masterfrom
Shimaadnan:master

Conversation

@Shimaadnan

@Shimaadnan Shimaadnan commented Aug 26, 2022

Copy link
Copy Markdown

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name:
  • Your City:
  • Your Slack Name:

Homework Details

  • Module:
  • Week:

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?


View rendered exercises/C-variables/README.md

@JihadOmer JihadOmer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

well done !

@Gevie Gevie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great effort Shima, you did a good job, there is just some minor feedback for you to take a look at for this first week module.

@@ -1 +1,3 @@
//noconsole.log("Hello world");

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 Shima, we don't usually leave commented out code in our pull requests.

You can read more about it here :) https://syllabus.codeyourfuture.io/guides/code-style-guide#dont-leave-lots-of-commented-out-code

@@ -5,6 +5,8 @@ We can use _variable_ to create a reference to a value.
```js
var greeting = "Hello world";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The exercises use var a lot so it's understandable that you would also use var. We encourage you to use let or const instead and never var.

  • let - When a variable is assigned, its value can change
  • const - When a variable is assigned, its value will never change, it is a constant.

We also don't need the ```js lines because this is more for markdown and will cause errors with your actual code.

Finally we only need the console.log(greeting); one time otherwise you say Hello World three times 👍

@@ -1,3 +1,5 @@
// Start by creating a variable `greeting`

var greeting = "Hello World";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The same feedback here Shima :) We only need the console.log one time and you can switch var greeting to const greeting 👍

@@ -1,3 +1,4 @@
// Start by creating a variable `message`

let message = "This is a string";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Brilliant work, this does exactly what is needed. The only comment would be to change let to const since we never change the value of message. Good job Shima.

let greeting = "Hello, "
let myname = "My name is Shima"
let message = greeting + myname;
console.log(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.

Fantastic work, this does the job, again it's just changing let to const since you never change the values of each variable. 👍


}
console.log(multiply(3,5,7));
console.log(getStringLength("Hello I am working"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Again, very well done on this exercise, you did it all correctly 👍 🥇

console.log(trimWord(" CodeYourFuture "));

function getStringLength(word) {
return word.length;

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 would take notice on your indentation... at some points you indent by 2 spaces and at other points you indent by 4 spaces.

We have a guide on indentation here: https://syllabus.codeyourfuture.io/guides/code-style-guide#indent-your-code

test("trimWord trims leading and trailing whitespace", () => {
expect(trimWord(" CodeYourFuture ")).toEqual("CodeYourFuture");
});
// test("trimWord trims leading and trailing whitespace", () => {

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 Shima, we shouldn't be commenting out or modifying the test cases. These are here to ensure that your work passes the predefined tests.

Would you be able to undo this and restore it the way it was originally?

}

//This function concatenate all the parameters which they can be string or numbers.
function concatenate(firstWord, secondWord, thirdWord) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There seems to be a missing line here, I'm not sure why? It should have the following within the body of the function:

return firstWord.concat(' ', secondWord, ' ', thirdWord);

It doesn't show in this code review but don't worry, your explanation is correct so we can just move on from here.

Comment thread mandatory/4-tax.js

function calculateSalesTax() {}
function calculateSalesTax(price) {
return price * 1.2;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very well done Shima! I have seen some other solutions which were more complicated, you took a very simple approach and I like it :)

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.

3 participants