V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jarlyyn
V2EX  ›  Node.js

现在非常喜欢用 bind 来解决 callback 中的 this 问题,有没有隐患?

  •  
  •   jarlyyn · 2014-10-28 14:56:26 +08:00 · 3093 次点击
    这是一个创建于 3440 天前的主题,其中的信息可能已经有所发展或是发生改变。
    如题。

    现在感觉凡是需要callback的地方,基本都是func.bind(this,aa,bb)这样来操作了
    1 条回复    2014-10-28 23:22:27 +08:00
    livelazily
        1
    livelazily  
       2014-10-28 23:22:27 +08:00 via Android
    参考 https://www.v2ex.com/t/122105 bind过后不能再bind
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2753 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 12:09 · PVG 20:09 · LAX 05:09 · JFK 08:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.