Created
June 12, 2018 17:18
-
-
Save jasp402/459611a3b5ab88c52180884fd9d93c23 to your computer and use it in GitHub Desktop.
JavaScript - Generar un Array con el numero de días del mes actual
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
function daysInMonth() { | |
return Array.from({length: new Date(new Date().getFullYear(), new Date().getMonth(), 0).getDate()}, (x,i)=> { return (i+1); }); | |
} | |
console.log(daysInMonth()); // 28 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment