Code playground (JavaScript) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Code playground (JavaScript)

‘getMonth();’ is getting January ( 1 ) but it’s February ( 2 )? https://code.sololearn.com/W3cVov3ygu6r/?ref=app

27th Feb 2022, 6:11 PM
Jamescabc
Jamescabc - avatar
3 Answers
+ 4
.getMonth() is zero based, i.e. values range from 0 to 11, not 1 to 12. https://www.w3schools.blog/getmonth-javascript-js
27th Feb 2022, 6:15 PM
Simon Sauter
Simon Sauter - avatar
+ 3
Thank you
27th Feb 2022, 6:17 PM
Jamescabc
Jamescabc - avatar
0
Оо
26th Nov 2022, 11:58 PM
The Fallen King
The Fallen King - avatar