推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
duhastmich

2吗?

  •  
  •   duhastmich · Jan 25, 2013 · 3440 views
    This topic created in 4882 days ago, the information mentioned may be changed or developed.
    fn = function(){
    console.log(1)
    return function(){
    console.log(3)
    }
    }

    (function(){
    console.log('2')
    })()
    7 replies    1970-01-01 08:00:00 +08:00
    0x0001
        1
    0x0001  
       Jan 25, 2013
    233
    markmx
        2
    markmx  
       Jan 25, 2013
    没看懂的路过 !

    @0x0001 能解释一下吗?
    undeflife
        3
    undeflife  
       Jan 25, 2013
    @markmx
    这代码等于
    fn = function(){
    console.log(1)
    return function(){
    console.log(3)
    }
    }()()
    luin
        4
    luin  
       Jan 25, 2013
    我曾经写过一篇文章,和这个很类似。代码中没加分号...
    http://zihua.li/2012/03/javascript-three-questions/
    第3题。
    duhastmich
        5
    duhastmich  
    OP
       Jan 25, 2013
    @undeflife
    @luin 少了个分号,搞了个中午...
    luin
        6
    luin  
       Jan 25, 2013
    @duhastmich 弄个jslint...
    duhastmich
        7
    duhastmich  
    OP
       Jan 25, 2013
    @luin 哈哈,一般写coffeescript
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5712 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 03:34 · PVG 11:34 · LAX 20:34 · JFK 23:34
    ♥ Do have faith in what you're doing.