Answers for "json.parse with date"

0

json.parse with date

const text =
  '{"name":"John", "birth":"1986-12-14", "city":"New York"}';

  const obj = JSON.parse(text);
obj.birth = new Date(obj.birth);

  
document.getElementById("demo").innerHTML = obj.name + ", " + obj.birth;
Posted by: Guest on September-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language