Q:

javascript serialization with required fields

Is there anyway to copy only required values to a object from JSON string.
JSON string
{  
   "name":"John",
   "age":31,
   "city":"New York",
   "place" : "Ne"
}

On conversion of above string the result should be
Object a= {"name":"John","address":"","place":"Ne"}

A:

You can try to use Object destructuring. Read more here.
const oldObj = {  
   "name":"John",
   "age":31,
   "city":"New York",
   "place" : "Ne"
}
const { name, age, city } = oldObj;
const newObj = { name, age, city };

