problem description
I need to process an object, filter out some keys and modify a key value to get the structure I want. Handle it with JSON.parse
combined with reviver
function. But get the weird result of undefined
.
Why can"t the following code get the results I want?
I can get the correct results now, but there are no errors in the following code. Please analyze why I can"t get the results I want.
the environmental background of the problems and what methods you have tried
operating environment: node V9.11.2
related codes
{
id: "5c34650e307f782408c4501b",
interName: "",
opt: "mac",
ruleStr: "00:0A:02:0B:03:0C",
algorithmOptRules: "afafafafaf"
}