Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manchester | Zabihollah Namazi | Module-Data-Flows | challenges | unit-testing | passing-tests #125

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ZabihollahNamazi
Copy link

just ignore the fetch commit please.

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@ZabihollahNamazi ZabihollahNamazi added the Needs Review Participant to add when requesting review label Jan 5, 2025
@tyzia tyzia added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jan 11, 2025
Toyota: 0,
};
for(let key in totals){
for(let obj in carsSold){
Copy link

Choose a reason for hiding this comment

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

I would suggest to rename obj to something more relevant here. Because for .. in will not iterate over objects in carsSold array. obj will not contain the whole object from this array. It will contain something else.

Copy link
Author

Choose a reason for hiding this comment

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

car would be better in my opinion

"Land Rover": 0,
Toyota: 0,
};
for(let key in totals){
Copy link

Choose a reason for hiding this comment

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

Can you think of a better name for key? Hint: think what it will contain and how you are going to use its value (you will compare it to make from array).

Copy link
Author

Choose a reason for hiding this comment

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

i think makeCar would be better


function average(numbers) {}

let numbers = [4, "-", 8, 11, "hello", "57", 0, 2, "hi", 22];
Copy link

Choose a reason for hiding this comment

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

I can't agree that numbers variable contains array of numbers. Do you? Also, if you are not going to reassign this variable to a new array, what is a better variable type here instead of let?

Copy link
Author

Choose a reason for hiding this comment

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

updated
thanks sir

}
}
console.log(numCount);
return numCount;
Copy link

Choose a reason for hiding this comment

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

It looks to me that you are returning counter (how many numbers you have found in the given array). I think your task is to return average.

Copy link
Author

Choose a reason for hiding this comment

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

fixed it

}

myData = await response.json()
//console.log(`${JSON.stringify(myData)} this is api`)
Copy link

Choose a reason for hiding this comment

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

Please, don't leave commented out code in your final work.

Copy link
Author

Choose a reason for hiding this comment

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

this commit is a mistake
sorry


async function fetchData() {
try{
const response = await fetch("https://xkcd.now.sh/?comic=latest")
Copy link

Choose a reason for hiding this comment

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

Please, always close your expressions with a semicolon ;

@tyzia tyzia added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jan 11, 2025
@ZabihollahNamazi ZabihollahNamazi added Complete Participant to add when work is complete and review comments have been addressed and removed Reviewed Volunteer to add when completing a review Needs Review Participant to add when requesting review labels Jan 12, 2025
@tyzia
Copy link

tyzia commented Jan 18, 2025

Thank you for the update. You can close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Participant to add when work is complete and review comments have been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants