Last active
December 15, 2023 19:38
-
-
Save queviva/c889fa4d02751879dd94504690248865 to your computer and use it in GitHub Desktop.
list of month names
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
const // create a var ... | |
months // called months ... | |
= // that is equal to ... | |
[...Array(12)] // a twelve element array ... | |
.map( // that gets mapped using ... | |
(v,i) => // an arrow function that ... | |
(new Date( // creates a new date of ... | |
0, // the year zero and ... | |
i // the index of the next month ... | |
)) // then | |
.toString() // converts that to a string and ... | |
.split(' ') // makes that string an array and ... | |
[1] // returns the 1th member of that array ... | |
); // then ends the map | |
console.log(months.join(' ')); // check it out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment