I ran into an interesting case with Date.parse is returning a valid date instead of NaN as I would think is expected.
So Date.parse('test 123')
returns -58285678164000
and Date.parse('123 test')
returns NaN
like I would think.
Can anybody explain to me why 'test 123'
returns a negative number and '123 test'
returns NaN
, trying to see how I can check if a string is a date using !isNaN(Date.parse(string))
but this case if giving me an issue.. and I'm just curious on why.