While its true most IDE's can search for references in strings, `nameof` takes
some of the guesswork out of determining whether a substring that matches a
symbol refers to the symbol or is merely part of the sentence.
That said, `nameof` is primarily a convenience for an IDE.
Ron
Sent from my
Hi forks,
Recently, we implemented Reflect.enumerate in WebKit JSC.
At that time, the question is raised When are the enumerated keys
determined?[1]
For example,
var object = ...;
var iterator = Reflect.enumerate(object);
object.newKey = hello;
// At that time, iterator.next() is not called
I was going to suggest a Set, now that ECMA has them…
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-set-objects
```js
if ((new Set([1,2,3,5]).has(a)) {
// stuff
}
```
On Sun, Aug 9, 2015 at 4:20 PM myemailu...@gmail.com wrote:
it could be used like this:
if ( a == 1
it could be used like this:
if ( a == 1 ||= 2 ||=3 ||=5) { //do something if a is either 1,2,3,5}
and it could be used like this
a || = 0
// a = a || 0
thanks
___
es-discuss mailing list
es-discuss@mozilla.org
`a ||= b` looks like an in-place logical or, like `+=`.
`a = a || b` would have very different semantics to that which you propose.
In Python this would be written:
```python
if a in [1, 2, 3, 5]:
# stuff
```
In JS we have similar but slightly less semantic:
```js
if ([1, 2, 3,
why create an array when there can be an operator. I think if we do survey
people will like this, ||=, it's more expressive.
On Sun, Aug 9, 2015 at 9:41 PM, Isiah Meadows isiahmead...@gmail.com
wrote:
Or, there is the likely ES7 Array#contains for comparing multiple numbers.
```js
[1, 2,
Isn't
prop ||= 0;
better than
prop = prop || 0;
and it can be even defined like this.
prop ||= var1 ||= var2 ||= 0;
but then i dont know how we can use it ike this
if (num == 3 ||=4 ||=6)
On Sun, Aug 9, 2015 at 9:47 PM, myemailu...@gmail.com wrote:
why create an array when there can be
Or, there is the likely ES7 Array#contains for comparing multiple numbers.
```js
[1, 2, 3].contains(value);
```
As for the operator proposed here, there's already an existing proposal for
a safer version which doesn't coerce:
http://wiki.ecmascript.org/doku.php?id=strawman:default_operator.
On
8 matches
Mail list logo