具有必填字段的javascript序列化

时间:2018-08-30 08:28:28

标签: javascript

无论如何,是否只能将所需的值从JSON字符串复制到对象。

JSON字符串

{  
   "name":"John",
   "age":31,
   "city":"New York",
   "place" : "Ne"
}

转换上述字符串时,结果应为

Object a= {"name":"John","address":"","place":"Ne"}

1 个答案:

答案 0 :(得分:0)

您可以尝试使用对象分解。了解更多here

REQUEST_TIMER = Summary('aes_request_processing_duration_seconds', 'Time spent processing requests')