-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
20 lines (20 loc) · 725 Bytes
/
index.js
File metadata and controls
20 lines (20 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
fetch("https://jsonplaceholder.typicode.com/users")
.then((data) => data.json())
.then((DataOfObject) => {
console.log(DataOfObject[0].id);
let tableData = "";
DataOfObject.map((values) => {
tableData += `<tr>
<td> ${values.id} </td>
<td> ${values.name} </td>
<td> ${values.username} </td>
<td> ${values.email} </td>
<td> ${values.phone} </td>
<td> ${values.website} </td>
<td> ${values.company.name} </td>
<td> ${values.company.catchPhrase} </td>
<td> ${values.company.bs} </td>
</tr>`;
});
document.getElementById("table_body").innerHTML = tableData;
});