I ran into a problem and couldn't fix it today. For example, there is a json file text.json
[
{
"id":1,
"name":"Jon",
"email":"John@gmail.com"
},
{
"id":2,
"name":"Sam",
"email":"Sam@gmail.com"
},
{
"id":3,
"name":"Dan",
"email":"Dan@gmail.com"
}
]
Now I want to use ajax to get this json file and here is the part doesn't work.
let output = users.map((i) => {
return `<ul>
<li>ID: ${users.id} </li>
<li>Name: ${users.name}</li>
<li>Email: ${users.email}</li>
</ul>`
})
Where should I put the i in template literals ?