Skip to content

Commit 749900a

Browse files
authored
Add files via upload
1 parent 85c2b2c commit 749900a

File tree

2 files changed

+124
-3
lines changed

2 files changed

+124
-3
lines changed

Week1/homework/app.js

Lines changed: 113 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,119 @@
44
const bookTitles = [
55
// Replace with your own book titles
66
'harry_potter_chamber_secrets',
7+
'awaken_the_giant_within_me',
8+
'if_tomorrow_comes',
9+
'unlimited_power',
10+
'the_power_of_positive_thinking',
11+
'the_power_of_character_in_leadership',
12+
'the_girl_on_the_train',
13+
'man_and_the_sea',
14+
'fiker_eske_mekabir',
15+
'keadmas_basher',
16+
'yetekolefebet',
717
];
18+
function bookListCreater(bookListobj) {
19+
const ul = document.createElement('ul');
20+
document.getElementById('bookListDiv').appendChild(ul);
821

9-
// Replace with your own code
10-
console.log(bookTitles);
22+
for (let propobj in bookListobj) {
23+
let li = document.createElement('li');
24+
ul.appendChild(li);
25+
li.innerHTML = propobj;
26+
//li.innerHTML = bookListobj[propobj];
27+
console.log(bookListobj[propobj]);
28+
}
29+
}
30+
31+
// Creating object
32+
let allBookInformation = {
33+
harry_potter_chamber_secrets: {
34+
bookInfo: {
35+
title: bookTitles[0].toUpperCase(),
36+
language: 'Eneglish',
37+
author: 'J. K. Rowling',
38+
},
39+
},
40+
awaken_the_giant_within_me: {
41+
bookInfo: {
42+
title: bookTitles[1].toUpperCase(),
43+
language: 'Eneglish',
44+
author: 'Tony Robbins',
45+
},
46+
},
47+
48+
if_tomorrow_comes: {
49+
bookInfo: {
50+
title: bookTitles[2].toUpperCase(),
51+
language: 'Eneglish',
52+
author: 'Sidney Sheldon',
53+
},
54+
},
55+
56+
if_tomorrow_comes: {
57+
bookInfo: {
58+
title: bookTitles[3].toUpperCase(),
59+
language: 'Eneglish',
60+
author: 'Tony Robbins',
61+
},
62+
},
63+
64+
unlimited_power: {
65+
bookInfo: {
66+
title: bookTitles[4].toUpperCase(),
67+
language: 'Eneglish',
68+
author: 'Dr. Norman Vincent Peale',
69+
},
70+
},
71+
72+
the_power_of_positive_thinking: {
73+
bookInfo: {
74+
title: bookTitles[5].toUpperCase(),
75+
language: 'Eneglish',
76+
author: 'Dr. Myles Munroe',
77+
},
78+
},
79+
80+
the_girl_on_the_train: {
81+
bookInfo: {
82+
title: bookTitles[6].toUpperCase(),
83+
language: 'Eneglish',
84+
author: 'Paula Hawkins',
85+
},
86+
},
87+
88+
man_and_the_sea: {
89+
bookInfo: {
90+
title: bookTitles[7].toUpperCase(),
91+
language: 'Eneglish',
92+
author: 'Ernest Hemingway',
93+
},
94+
},
95+
96+
fiker_eske_mekabir: {
97+
bookInfo: {
98+
title: bookTitles[8].toUpperCase(),
99+
language: 'Amharic',
100+
author: 'Dr. Haddis Alemayehu',
101+
},
102+
},
103+
104+
keadmas_basher: {
105+
bookInfo: {
106+
title: bookTitles[9].toUpperCase(),
107+
language: 'Amharic',
108+
author: 'Be alu Girma',
109+
},
110+
},
111+
112+
yetekolefebet: {
113+
bookInfo: {
114+
title: bookTitles[10].toUpperCase(),
115+
language: 'Amharic',
116+
author: 'Dr Mihret Debebe ',
117+
},
118+
},
119+
};
120+
console.log(allBookInformation);
121+
bookListCreater(allBookInformation);
11122
}

Week1/homework/index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
<!-- replace this with your HTML content -->
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>JS-Home Work-1</title>
5+
<meta lang="en" />
6+
</head>
7+
<body>
8+
<div id="bookListDiv"></div>
9+
<script type="text/javascript" src="app.js"></script>
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)