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

Skip to content

Commit e1fef8b

Browse files
committed
added updated_at
1 parent e759015 commit e1fef8b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

homework/src/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
let forkArray = [];
4343
let languageArray = [];
4444
let descriptionArray = [];
45+
let updatedAt = [];
4546
let htmlArray = [];
4647
let contributorsArray = [];
4748
for (let i = 0; i < data.length; i++){
@@ -50,11 +51,13 @@
5051
descriptionArray.push(data[i].description);
5152
forkArray.push(data[i].forks);
5253
languageArray.push(data[i].language);
54+
updatedAt.push(data[i].updated_at);
5355
contributorsArray.push(data[i].contributors_url);
5456
contributorsArray.sort();
5557
htmlArray.push(data[i].html_url);
5658
htmlArray.sort();
5759
}
60+
5861

5962
let app = document.getElementById('root');
6063
const header = createAndAppend('h1', app, { text: "Hack Your Future Repositories", class: 'title' });
@@ -83,22 +86,23 @@
8386
while (contributorsUl.hasChildNodes()) {
8487
contributorsUl.removeChild(contributorsUl.firstChild);
8588
}
86-
}
87-
89+
} //end removeNodes
90+
8891
selectList.onchange = function(selectedIndex){
8992
let RepoName = createAndAppend('li', ul, { text: "Repository: ", class: 'nameInContainer', function: removeNodes()});
9093
createAndAppend('a', RepoName, { text: newArray[this.selectedIndex], id: 'linkInContainer', target: "_blank", href: htmlArray[this.selectedIndex]});
9194
createAndAppend('li', ul, {text: "Description: " + descriptionArray[this.selectedIndex], class: 'descriptionInContainer'});
9295
createAndAppend('li', ul, { text: "Number of Forks: " + forkArray[this.selectedIndex], class: 'forksInContainer'});
9396
createAndAppend('li', ul, { text: "Language: " + languageArray[this.selectedIndex], class: 'languageInContainer'});
97+
createAndAppend('li', ul, {text: "Updated at: " + updatedAt[this.selectedIndex], id: 'updatedAtInContainer'})
9498
createAndAppend('li', contributorsUl, { text: contributorsArray[this.selectedIndex], class: 'contributorsInContainer'});
9599
}
96100
});
101+
97102
/*
98103
fetchJSON( theContributors_URL, (err, data) => {
99104
let theContributorsUrl = [];
100105
for (let i = 0; i < data.length; i++){
101-
102106
}
103107
});*/
104108
}

0 commit comments

Comments
 (0)