JSON+Node.js - Unexpected token o

前端 未结 2 846
悲哀的现实
悲哀的现实 2020-12-15 17:28

I just started working with node.js and json objects in my college course. One of our assignments this week was to create a few json objects and extract parts of the object

2条回答
  •  一整个雨季
    2020-12-15 18:05

    the solution is to use JSON.stringify as follows

    var target=JSON.parse(JSON.stringify(source));
    

提交回复
热议问题