Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Instead of using the reviver you can deserialize as a plain string, then later reassign the property as the type you want. E.g.:

  const myObject = JSON.parse(text);
  myObject.date = new Date(myObject.date);


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: