Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var arr = [
- {
- name: 'hoho',
- items: [
- {
- a : 1
- }
- ]
- }
- ]
- var q = arr.reduce(function(acc, o){
- _.each(o.items, function(item){
- item.a = 2;
- })
- acc.push(o);
- return acc;
- });
- console.log(q);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement