Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

homework/index.js Outdated Show resolved Hide resolved
homework/index.js Outdated Show resolved Hide resolved
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.