V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
lichgo
V2EX  ›  Node.js

Node.js/JavaScript 有什么比较函数式编程风格的写法?

  •  2
     
  •   lichgo · Apr 28, 2014 · 6649 views
    This topic created in 4394 days ago, the information mentioned may be changed or developed.
    指的是日常开发中可以写得比较functional programming风格的写法。
    Supplement 1  ·  Apr 29, 2014
    如果有sample code那就更好了。
    7 replies    2014-04-30 08:46:59 +08:00
    11
        1
    11  
       Apr 28, 2014   ❤️ 1
    map
    ravenw
        2
    ravenw  
       Apr 28, 2014   ❤️ 1
    underscore.js/lodash.js
    jsonline
        3
    jsonline  
       Apr 28, 2014 via Android   ❤️ 1
    promise
    callback
    curry
    jakwings
        4
    jakwings  
       Apr 28, 2014   ❤️ 1
    同上上上上上……
    Promise 是 ES6 才原生支持的。
    函数相当于一等公民就不就多说了。
    Curry 是用 .bind() 实现的。
    数组的方法也很明显: http://devdocs.io/javascript/global_objects/array
    sodatea
        5
    sodatea  
       Apr 29, 2014   ❤️ 1
    lichgo
        7
    lichgo  
    OP
       Apr 30, 2014
    感谢诸位的回复。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3022 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 07:21 · PVG 15:21 · LAX 00:21 · JFK 03:21
    ♥ Do have faith in what you're doing.