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

Skip to content

Javascript 3 project branch #7

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 23 commits into
base: Nikos-Spiropoulos
Choose a base branch
from

Conversation

spiropoulos94
Copy link

No description provided.

let reposBanner = document.createElement('H1');
reposBanner.innerHTML = 'HYF REPOSITORIES';
document.getElementById('root').appendChild(reposBanner);
reposBanner.className += 'banner';

Choose a reason for hiding this comment

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

There should be as little code as possible that leaves outside of a function. It is better to place this code inside a init() function of example and just call init at the beginning of your code

let reposIndices = [];
for (let x = 0; x < 10; x++) {
reposIndices.push(repos[x]);
}

Choose a reason for hiding this comment

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

This is a classic case of a map function

a.setAttribute('target', '_blank');
createAndAppend('p', ul, { text: `Description : ${repo.description}` });
createAndAppend('p', ul, { text: `Forks : ${repo.forks}` });
var dateobj = new Date(repo.updated_at);

Choose a reason for hiding this comment

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

Try not to use var. Prefer const or let

}

repos = reposIndices;
console.log(repos);

Choose a reason for hiding this comment

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

Try not to use console.log in your final code

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