0

Am just starting out with Livescript and want to know how the scope works.

Are the any good example/docs that show all scope symbols and usage. Symbols like:

  • @
  • -> vs ~>
  • self
  • :=

Edit

The problem I face:

This ethercalc code: line 103. I want to insert a call to a Java script function, i.e. to this send email code.

Community
  • 1
  • 1
eddyparkinson
  • 3,680
  • 4
  • 26
  • 52

1 Answers1

1

http://livescript.net documents all that functionality.

  • @ means this.
  • @prop means this.prop

  • -> creates a function, it means function(){}

  • -> blah() is function(){ return blah(); }
  • (a, b) -> foo is function(a, b) { return foo; }

  • self is nothing special, just the name of a variable. Often set to this of an upper scope.

  • := means "reassign a variable" - it must already exist. It does not create a new variable. Check out http://livescript.net/#introduction for more info

gkz
  • 416
  • 3
  • 5