Skip to content

Commit

Permalink
Merge pull request mouredev#3974 from Othamae/main
Browse files Browse the repository at this point in the history
Reto mouredev#12 - javascript
  • Loading branch information
Roswell468 authored Jun 29, 2023
2 parents 17d8a64 + 62bdc60 commit a47f3ac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Retos/Reto #12 - VIERNES 13 [Fácil]/javascript/othamae.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Crea una función que sea capaz de detectar si existe un viernes 13 en el mes y el año indicados.
* - La función recibirá el mes y el año y retornará verdadero o falso.
*/

const isFriday13th = (month, year) => {
const date = new Date(year, month - 1, 13);
return date.getDay() === 5;
}

console.log(isFriday13th(5, 2020));
console.log(isFriday13th(10, 2021));
console.log(isFriday13th(5, 2022));
console.log(isFriday13th(7, 2023));
console.log(isFriday13th(6, 2024));

0 comments on commit a47f3ac

Please sign in to comment.