Commit 272c90d8 authored by Leon's avatar Leon

upload

parent a7e7600a
// var _ = require("lodash");
var data = {
a: 'md5_1',
b: 'md5_2',
c: '[{"md5": "md5_3"},{"md5": "md5_4"}]'
};
var r = Object.values(data).reduce(function(prev, curr) {
try {
var temp = JSON.parse(curr);
temp = temp.map(x => x.md5);
prev = prev.concat(temp);
} catch (e) {
prev.push(curr);
}
return prev;
}, []);
console.log(JSON.stringify(r, null, ' '));
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment