Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Javascript3 - Week3-Project-AmirHossein #6

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

amirhshad
Copy link

No description provided.

}
}

const abdulkareem = Person('Abdulkareem', 35, 'Riyadh', 'married', '3 children', 'construction worker', ['dates', 'smoke water pipe'] );
Copy link

Choose a reason for hiding this comment

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

In your constructor age is the third input while here you have 35 as second. Ordering matters for unnamed arguments.

async function getData(url) {
try {
const response = await fetch(url);
return console.log(response)
Copy link

Choose a reason for hiding this comment

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

This is wrong, you're returning console.log() output which is empty. You should return the promise in getData.

@@ -0,0 +1,58 @@
function getData(url) {
Copy link

Choose a reason for hiding this comment

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

Remove this. you have another getData function




function getData1() {
Copy link

Choose a reason for hiding this comment

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

This function is strange. You don't have a param url yet you use it in there. If you don't reuse this function you might as well just call what's inside it without defining it.

@@ -0,0 +1,8 @@

// const errorBox = elFactory('div', {id: 'error'});
async function fetchData(url) {
Copy link

Choose a reason for hiding this comment

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

why don't you use this function in the other examples or wasn't it not part of the homework?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants