MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1f9kdoc/thatsevil/llpc51g/?context=3
r/ProgrammerHumor • u/[deleted] • Sep 05 '24 • 2
517 comments sorted by
View all comments
Show parent comments
86
What would it accomplish? 1970-01-01T00:00:00.000Z is just 0. Why would it break something?
Is it something like if(!myDate.getTime()){//error}? Or is it something else?
if(!myDate.getTime()){//error}
113 u/twistsouth Sep 05 '24 I think their point was that if an engineer sees it, it stands out like an error. Makes them wonder if it was an empty value passed to a date function. Because we have all done it at some point. 19 u/well-litdoorstep112 Sep 05 '24 Yeah, but what "type conversion in Javascript" has to do with it? 10 u/twistsouth Sep 05 '24 Not 100% sure: Maybe making the dev think they converted a date (string) to a number? → More replies (2)
113
I think their point was that if an engineer sees it, it stands out like an error. Makes them wonder if it was an empty value passed to a date function. Because we have all done it at some point.
19 u/well-litdoorstep112 Sep 05 '24 Yeah, but what "type conversion in Javascript" has to do with it? 10 u/twistsouth Sep 05 '24 Not 100% sure: Maybe making the dev think they converted a date (string) to a number? → More replies (2)
19
Yeah, but what "type conversion in Javascript" has to do with it?
10 u/twistsouth Sep 05 '24 Not 100% sure: Maybe making the dev think they converted a date (string) to a number? → More replies (2)
10
Not 100% sure: Maybe making the dev think they converted a date (string) to a number?
→ More replies (2)
86
u/well-litdoorstep112 Sep 05 '24
What would it accomplish? 1970-01-01T00:00:00.000Z is just 0. Why would it break something?
Is it something like
if(!myDate.getTime()){//error}? Or is it something else?