5 ms·
Fun fact: Not even the whole of number type is safe to clone with the JSON method, because Infinity or NaN turn into null. So one can’t infer JSON-clonability
by kalmi10 8y ago
Fun fact: Not even the whole of number type is safe to clone with the JSON method, because Infinity or NaN turn into null.
So one can’t infer JSON-clonability from TypeScript/JavaScript types. Learned this the hard way.