-1 Please no :)
> On Aug 11, 2015, at 2:40 AM, Soni L. wrote:
>
> x .= f() should be syntax sugar for x = x.f()
>
> x .= f().g().h() should be x = x.f().g().h()
>
> --
> Disclaimer: these emails are public and can be accessed from non-DHCP IP and put it here>. If you do not agree with this,
Add a `self` decorator to functions that makes them return `this` by default.
export function self myMethod () {
// return this by default
}
This decorator could be used to make any function bound to the current scope
`this` as well so:
Unless you have a specific requirement I am missing, your use case is more
elegantly resolved IMO using a custom generator that yields exactly the
information you need per iteration.
A functional approach using a function that has the information you need is
also another valid solution.
--
This and arrow generators would be a nice thing to have.
> On Jul 13, 2015, at 11:42 PM, Matthew Robb wrote:
>
> Are there any proposals or any discussions around solving the problem of
> instance bound class methods with some sugar?
>
> There are examples of people doing things like this:
>
Exactly, but the reason I proposed this is because the method your are
describing was not satisfactory enough / I found it inconvenient.
Regards
> On Jul 13, 2015, at 6:00 PM, Michał Wadas wrote:
>
> let stuff = ()=>{ try {
> return f();
> } catch(e){ return f; } }();
> 14 chars more.
>
>
What about:
foo({ bar: 5 })
function foo ({ baz, bak, bar }) {
console.log(bar)
}
Or is there anything else you are considering or something I am missing.
Regards
> On Jul 12, 2015, at 6:47 AM, Benjamin Gruenbaum wrote:
>
> Hey, I wasn't able to find i
Allow `try…catch` blocks to return a value.
Sometimes I wrap a `try…catch` in a function and return a value based in
whether there was an error or not.
It would be useful if you could use `return` inside a `try…catch` block to
accomplish the same.
```js
let stuff = try {
return ...
} cat
Allow `try…catch` blocks to return a value.
Sometimes I wrap a `try…catch` in a function and return a value based in
whether there was an error or not.
It would be useful if you could use `return` inside a `try…catch` block to
accomplish the same.
```js
let stuff = try {
return ...
}
On Jun 26, 2015, at 9:42 AM, Salvador de la Puente González
wrote:
>
> And remember you always can use the explicit global object to avoid
> collisions.
Indeed. Thanks for mentioning that.___
es-discuss mailing list
es-discuss@mozilla.org
https://mai
// solution
function doSomething ({ a: true } = {}) {
console.log(a)
}
```
I find that for complex objects (such as options to methods),
having to make the argument’s default value `{}` in every
function declaration inconvenient.
Let me know your feedback / comments.
Regards
Jorge Bucaran
Hi folks
I have been fidingly with ES6 for over a year now, but for even longer I have
been longing for a more expressive and honestly simpler build system /
automation tool. I have dabbled with gulp, grunt and brunch and while they do
get the job done and are great in their own way, I feel the
mail.com>> wrote:
> What would happen if this operator was used in the global scope?
>
> On Thu, Jun 25, 2015 at 3:41 PM, Bucaran <mailto:jbuca...@me.com>> wrote:
> Sometimes you have a function that receives a parameter shadowing an existing
> function or variable in
Sometimes you have a function that receives a parameter shadowing an existing
function or variable in the parent scope.
In _some_ cases I would like to use the same variable name to avoid having to
come up with new names. Contrived example ahead:
```js
import path from "path"
function doSometh
Hey Kyle
True for `continue` and `break`, but maybe it’s about time we stop using these
archaic control structures anyway :)
As for `return` I don’t see what’s the problem if you return your value inside
the IIFE as well.
Regards
> On Jun 20, 2015, at 10:10 PM, Kyle Simpson wrote:
>
> Just
Hi.
I have never written a proposal before, but I would love if it was possible to
do the following in JavaScript:
```js
// This code exposes a function that when called bound to an `object` inserts a
method in that `object`.
// The following are 3 ways to do this, the last one being my proposa
I see what you mean.
I always try to favor functional-style JavaScript (creating a big expression
composed
of several functions, both as arguments or declared somewhere, using recursion
instead of keeping state, not using control structures, no variables, etc),
hence my
suggestion.
Performanc
Another way: Instead of using `let` at all, why not creating a function and
pass it your `a`, `b` and `c` as arguments.
Nowadays I try to program without explicitly declaring any variables, hence my
suggestion.
```js
(function (a, b, c) {
}(2))
```
If you can post a more concrete example
JS is very much like writing with a pen (traditionally speaking). We can only
try to make less errors
as we move forward, but what’s there it’s there and it’s either too expensive
or impossible to change.
> On Jun 13, 2015, at 7:33 AM, Allen Wirfs-Brock wrote:
>
>
> On Jun 12, 2015, at 2:4
I followed the link, but the example was a bit different from this one and you
are using the assignment operator.
> On Jun 12, 2015, at 3:19 AM, Domenic Denicola wrote:
>
> I don’t think we should make it easier to shoot yourself in the foot by
> auto-binding methods (and thus creating new cop
Read as much as I could, but it was getting too long, so just to quickly
summarize:
While you can’t:
```js
export default let a = 1
```
You certainly can:
```js
let a = 1
export default a
```
Or
```js
let a = 1
let b = 2
let c = 3
export default {
A: a,
B: b,
C: c
}
```
Cheers
20 matches
Mail list logo