Calling coffeescript functions from console

前端 未结 4 979
南旧
南旧 2020-12-29 07:30

Playing a little with coffeescript and Rails 3.1.0.rc4. Have this code:

yourMom = (location) ->
  console.log location

yourMom \"wuz hur\"
4条回答
  •  粉色の甜心
    2020-12-29 08:18

    I'm not sure about Rails but the CoffeeScript compiler has an option (--bare) to compile without the function wrapper. Fine for playing but it does pollute the global scope.

提交回复
热议问题