Answer the question
In order to leave comments, you need to log in
Insert elements into dom via map or foreach?
document.querySelector("#mapBtns").innerHTML = coords
.map(
(e, i) =>
`<button class="map-btn ${
i == 0 ? "active" : ""
}" data-coord="${JSON.stringify(e.coord)}">${e.title}</button>`
)
.join("");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question