-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add clase05 & clase06 #26
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bravissimo Dani! 🥳
Te he puesto un comentarios en los de fechas, échale un ojo y me cuentas
} | ||
}, | ||
ordenarPorNombre(){ | ||
return this.libros.sort(({ nombre: a }, { nombre: b }) => a > b ? 1 : -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Genial!
/* 1 - ¿Qué fecha será dentro de 30 días? */ | ||
|
||
let today = new Date() | ||
today.setDate(30) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
con esto estás cambiando el valor a 30, no estás haciendo que sea dentro de 30 días 😬
|
||
var diferencia = new Date(hoy - inicioCurso); | ||
|
||
console.log(diferencia.getDate()); // dias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
esta diferencia realmente no es precisa con lo que buscamos. La forma de pasar esa diferencia a días/ horas es mediante aritmética 😬
|
||
/* 3 - Expresar la fecha completa de vuestro cumpleaños en el formato de vuestro ordenador y en el de Inglaterra */ | ||
|
||
const cumple = new Date(1984, 1, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Menuda suerte nacer en nochevieja 😂
const array2 = [1,3,5,5,9,10] | ||
|
||
function findRepeatedItems(array1, array2) { | ||
let repeatedItems = array1.filter(elem => array2.includes(elem)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a nivel rendimiento, es mucho más eficiente que la búsqueda sea siempre sobre un Set que sobre un array (Set.get()
)
No description provided.