8000 Javascript 3 project branch by spiropoulos94 · Pull Request #7 · SocialHackerCreteClass/JavaScript3 · GitHub
[go: up one dir, main page]

Skip to content

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

0