-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit af5492a
Showing
8 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const funcTareas = require('./funcionesArchivos'); | ||
|
||
const accion = process.argv[2]; | ||
|
||
switch (accion) { | ||
case 'listar': | ||
const tareas = funcTareas.listar(); | ||
console.log('Listado de tareas'); | ||
console.log('-----------------'); | ||
for (let index = 0; index < tareas.length; index++) { | ||
// console.log((index + 1) + '. ' + tareas[index].titulo + ' - ' + tareas[index].estado); | ||
console.log(`${index + 1}. ${tareas[index].titulo} - ${tareas[index].estado}`); | ||
} | ||
break; | ||
case undefined: | ||
console.log('Atención - Tienes que pasar una acción.'); | ||
console.log('---------------------------------------'); | ||
break; | ||
default: | ||
console.log('No entiendo qué quieres hacer.'); | ||
console.log('------------------------------'); | ||
break; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Requiero la libreria fs | ||
const fs = require('fs'); | ||
|
||
module.exports = { | ||
listar: () => { | ||
const fileTareas = fs.readFileSync('tareas.json', 'utf-8'); | ||
return JSON.parse(fileTareas); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"titulo": "Repasar JS", | ||
"estado": "terminada" | ||
}, | ||
{ | ||
"titulo": "Armar apliación de tareas", | ||
"estado": "en progreso" | ||
}, | ||
{ | ||
"titulo": "Break", | ||
"estado": "pendiente" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const fruits = ['Manzana', 'Pera', 'Naranja']; | ||
|
||
for (let index = 0; index < fruits.length; index++) { | ||
console.log('Ciclo for: ', fruits[index]); | ||
} | ||
|
||
let index = 0; | ||
while (index < fruits.length) { | ||
console.log('Ciclo while: ', fruits[index]); | ||
index++; | ||
} | ||
|
||
do { | ||
console.log('Ciclo do while'); | ||
index++; | ||
} while (index < fruits.length); | ||
|
||
// console.log(fruits); | ||
|
||
// fruits.push('Mandarina'); | ||
|
||
// console.log(fruits); | ||
|
||
// fruits.unshift('Banana'); | ||
|
||
// console.log(fruits); | ||
|
||
// fruits.pop(); | ||
|
||
// console.log(fruits); | ||
|
||
// fruits.shift(); | ||
|
||
// console.log(fruits); | ||
|
||
// const indexOfPera = fruits.indexOf('Pera'); | ||
|
||
// console.log(indexOfPera); | ||
|
||
// const isPera = fruits.includes('Pera'); | ||
|
||
// console.log(isPera); | ||
|
||
|
||
// console.log(fruits[fruits.length - 1]); | ||
|
||
// const message = fruits.join(' -|- '); | ||
|
||
// console.log(message); | ||
|
||
// const found = true; | ||
// const age = 18; | ||
|
||
// const message = found || age > 18 ? 'Found' : 'Not found'; | ||
|
||
// const message2 = found || 'message 2'; | ||
|
||
// if (found) { | ||
// message = 'Found' | ||
// } | ||
|
||
// console.log(message); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const funcTareas = require('./funcionesArchivos'); | ||
|
||
const accion = process.argv[2]; | ||
|
||
switch (accion) { | ||
case 'listar': | ||
const tareas = funcTareas.listar(); | ||
console.log('Listado de tareas'); | ||
console.log('-----------------'); | ||
for (let index = 0; index < tareas.length; index++) { | ||
// console.log((index + 1) + '. ' + tareas[index].titulo + ' - ' + tareas[index].estado); | ||
console.log(`${index + 1}. ${tareas[index].titulo} - ${tareas[index].estado}`); | ||
} | ||
break; | ||
case undefined: | ||
console.log('Atención - Tienes que pasar una acción.'); | ||
console.log('---------------------------------------'); | ||
break; | ||
default: | ||
console.log('No entiendo qué quieres hacer.'); | ||
console.log('------------------------------'); | ||
break; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Requiero la libreria fs | ||
const fs = require('fs'); | ||
|
||
module.exports = { | ||
listar: () => { | ||
const fileTareas = fs.readFileSync('tareas.json', 'utf-8'); | ||
return JSON.parse(fileTareas); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[ | ||
{ | ||
"titulo": "Repasar JS", | ||
"estado": "terminada" | ||
}, | ||
{ | ||
"titulo": "Armar apliación de tareas", | ||
"estado": "en progreso" | ||
}, | ||
{ | ||
"titulo": "Break", | ||
"estado": "pendiente" | ||
} | ||
] |