JavaScript Gotcha
If you are in the U.S. execute this JavaScript:
alert(new Date("2012-01-01").getFullYear());
Want to know why it returns 2011? Read my article
Written by JD Isaacks
Related protips
1 Response
Nice gotcha. I appreciate that you gave a little intro on the Coderwall post and not just a link to your blog. I am seeing that a fair amount lately.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Related Tags
#javascript
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#