-
Notifications
You must be signed in to change notification settings - Fork 4
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
base: Nikos-Spiropoulos
Are you sure you want to change the base?
Javascript 3 project branch #7
Conversation
let reposBanner = document.createElement('H1'); | ||
reposBanner.innerHTML = 'HYF REPOSITORIES'; | ||
document.getElementById('root').appendChild(reposBanner); | ||
reposBanner.className += 'banner'; |
There was a problem hiding this comment.
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]); | ||
} |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
homework/index.js
Outdated
} | ||
|
||
repos = reposIndices; | ||
console.log(repos); |
There was a problem hiding this comment.
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
No description provided.