r/javascript • • May 28 '19

What are some JavaScript things beginners don't know?

333 Upvotes

383 comments sorted by

View all comments

Show parent comments

5

u/amdc !CURSED! May 28 '19

that's pretty much everywhere

0

u/[deleted] May 28 '19

[deleted]

0

u/[deleted] May 28 '19

[deleted]

1

u/the_argus May 28 '19

getDay() is zero based for same reason getMonth() is. So you can have an array of labels and use the result to get the correct index.