<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Números pares del 1 al 100</title>
</head>
<body>
<div id="app">
</div>
<script src="/index.js"></script>
</body>
</html>
const app = document.getElementById("app")
const ul = document.createElement("ul")
let count=0;
const render = (inicio, final) => {
let arr = []
for (let index = inicio; index <= final; index++) {
if((index%2) == 0){
count++
arr.push(`<li> ${index}</li>`)
}
}
arr.push("<br>")
arr.push(`Numeros pares: ${count}`)
return arr.join(" ")
}
let inicio = parseInt(prompt("ingrese dato de inicio"))
let final = parseInt(prompt("ingrese final"))
const html = render(inicio, final)
ul.innerHTML = html
app.append(ul)