Underscore 互动版

在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

tag

tag:

对象作为参数来调用函数,作为函数链式调用的一环

    console.log(
        _.chain([1,2,3,200])
            .filter(function(num) { return num % 2 == 0; })
            .tap(console.log)
            .map(function(num) { return num * num })
            .value()
    );
    => [ 2, 200 ]
    [ 4, 40000 ]
将上文中的示例,在右侧javascript代码框中实现。