Babak B.
Babak B.
This would be awesome.
I don't think so... ```javascript const num = params => params.cond1 && params.cond2 ? 100 : 10 console.log(num) // [Function] console.log(num()) // 100 or 10 const num2 = if (params.cond1...
Please don't add `*` to each `if*` etc.. that is, in my opinion, clunky and ugly. Since inception JavaScript `if` returns void. So if it started to return the last...
No asterisks! :-)
@ljharb Hey Jordan, this must be a warning from a linter, in Node I get `> if (true) { [1,2] }` `[ 1, 2 ]`
@tasogare3710 This syntax would really confuse a newcomer to JavaScript. The asterisk is taking too many personalities. `function*` is a generator. With `for*` it returns an implicit First off, I'm...
@ljharb Hey Jordan index.js ```javascript if(true) { [1,2] } ``` `$ node index.js` `$` no errors
Give me an example how it breaks old code if `if` starts returning values
Give me an example of how the functional fib example doesn't work. It works, tested.
Ah, ok, give me an example where a generator function does something that can't be done using functions. Anything iterative can be done using recursion, this is a proven mathematical...