Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add clase05 & clase06 #26

wants to merge 1 commit into from

Conversation

danysainero
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@totegsito totegsito left a 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)
Copy link
Collaborator

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)
Copy link
Collaborator

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
Copy link
Collaborator

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);
Copy link
Collaborator

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));
Copy link
Collaborator

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())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants