1

I am reading some ES6 code with lambda and promisejs

 .then(_ => current.quit())

I am wondering _ mean in the lambda expression. I tried to change it to (), it also work.

Adam Lee
  • 24,710
  • 51
  • 156
  • 236
  • 1
    http://stackoverflow.com/questions/18300654/underscore-arrow-what-is-this – mplungjan Mar 29 '17 at 14:38
  • It's a parameter name. Nothing special. `function foo(_) { ... }` or `function foo(bar) { ... }` –  Mar 29 '17 at 14:39
  • `_` means the same thing in ES6 as it has always meant since the beginning. Remember, we even have several libraries that use `_` the same way jQuery use `$` (lodash, underscore). It's just a variable name. You can replace it with `tmp` or `x` or `foo` – slebetman Mar 29 '17 at 14:50

0 Answers0