immutable List操作

import { Map, fromJS, merge, List } from "immutable";

const data = fromJS({
    users: [{
        name: 'zhangsan',
        age: 18,
        friends:[{
            name: 'liuliu',
            age: 16
        },{
            name: 'lilei',
            age: 17
        }]
    },{
        name: 'lisi',
        age: 20,
        friends:[{
            name: 'hmm',
            age: 28
        }]
    },{
        name: 'wangwu',
        age: 33,
        friends:[{
            name: 'sam',
            age: 35
        }]
    }]
})

我现在想在users里面name=zhangsan的friends再添加 一个{name:'xiaoming',age: 12},我该如何写?

阅读 410
评论
    0 个回答
    撰写回答

    登录后参与交流、获取后续更新提醒