Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions client/01-for-each.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
</head>
<body>
<h1>Lista de tareas</h1>
<div id="app"></div>
<script >
const checkList = [
{ title: 'Hacer la cama'},
{ title: 'Comrpar los médicamentos'},
{ title: 'Pasear al perro'},
{ title: 'Redactar el correo a mi madre'}

];

const app = document.getElementById('app');

checkList.forEach(task => {
app.innerHTML += `<li>${task.title} <input type="checkbox"></li>`
});

</script>
</body>
</html>
8 changes: 8 additions & 0 deletions server/01-for-each.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const letters = ['a','b','c'];

for (let i=0; i < letters.length; i++ ){
const element = letters[i];
console.log('for', element);
}
//Método forEach
letters.forEach(item => console.log('forEach',item))