Humanity

Edit the world by your favorite way

2016-08-19から1日間の記事一覧

new Date('hoge').toString() が 'Invalid Date' になる

JS長いこと仕事で書いてきたのに「無効な Date 型の値」なんてものがあるのを初めて知った…— tyru (@_tyru_) 2016年8月19日 new Date('hoge') がエラーじゃなく無効な値を持つ Date 型の値なんてものを作れてしまう。isNaN(date.getTime()) で判定する。date…